Leganés were still on the Bernabéu pitch close to midnight, long after Real Madrid players and their fans had departed head down and in silence. There were a few hundred of the visiting supporters still in the stadium, joining them in celebration of reaching the Copa del Rey semi-final for the first time in their history – and against the European champions. Zinedine Zidane’s side, already 19 points behind Barcelona in the league, are out of the cup too. Pressure builds and Paris Saint Germain approach: all or nothing on Valentine’s Day.

Marco Asensio had scored a last-minute winner at Butarque in the first leg which gave Madrid an advantage that it was difficult to imagine them relinquishing but a 2-1 defeat saw them knocked out on away goals. They were without Gareth Bale and Cristiano Ronaldo, Zidane rotating as tends to be the case in the cup, but that was no consolation and no excuse either.

It will, though, serve to increase the tension. “It’s a bad night, we didn’t expect it – that’s the truth,” Real Madrid’s institutional director, Emilio Butragueño, said.

Madrid’s players had left the pitch without a word. None stopped for the protocol pitch-side interview. Gabriel Pires, the Leganés midfielder, did. “I laughed, I was happy, you forget everything, I don’t really know what I thought,” he said.

Javier Eraso curled in a wonderful opening goal and, although Karim Benzema equalised early in the second half, Pires’s towering header ultimately sent his team through. Leganés’s appropriately named goalkeeper Nereo Champagne described it as a “magical night, historic for us.”

“We were not good enough,” Zidane said. “I feel responsible, very responsible. This is a failure – of course. But we’ll continue: there’s nothing else we can do.”

This result will damage a manager whose position, despite winning two successive Champions Leagues and the league title, has come under question. It was an amazing result – and yet in a sense, it was not; it was logical, in line with the season so far and Madrid’s cup run.

This was Madrid’s sixth cup game; none have been impressive. For the third round in a row they conceded two at home. After a 2-0 win at second division B side Fuenlabrada, secured with two penalties, they were held 2-2 at the Bernabéu; after a 3-0 win at second division Numancia, when the first two goals were penalties, they were again held 2-2; and now, having performed poorly but won 1-0 at Leganés, they were beaten 2-1.

They pushed for the goal that would have sent them through but there was little clarity, little imagination, just crosses swung into the area, and Champagne had to make only two saves. The home side had fewer shots than the visitors. “It hurts, we’re hurt,” said Dani Carvajal, one Real Madrid player who did speak. “We didn’t even get a draw with Leganés at home, so we don’t deserve to go through. Realistically all we have is the Champions League now.”