Los Blancos managed to blow a 1-0 lead and lose 2-1 to a third-tier team that was down to ten men, getting themselves knocked out of a cup competition Zinedine Zidane is yet to win as either a player or a coach.
Madrid went into the game hoping to bounce back from their disappointment last week, when they were beaten in the semi-final of the Supercopa de Espana by Athletic Bilbao.
Madrid dominated the first half but lacked the ingenuity in the final third that would have put them out of sight.
Los Blancos continued to fail to impose themselves on the game, however, and Alcoyano began to believe they could cause an upset.
They got their moment ten minutes from time, when Jose Solbes scored at the same back post as Militao to level terms and spark a nervous final stage.
The game went into extra-time, with Alcoyano’s Ramon Lopez seeing red for a late challenge on Casemiro, a second yellow.
Remarkably, however, ten-man Alcoyano managed to grab a late winner at the end of extra-time, Juanan Casanova finishing off a quick break to make real one of the most remarkable upsets in the history of Spanish football.