Gabriel headed a second-half winner as Leganes won 2-1 at the Bernabeu Stadium to dump Real Madrid out of the Copa del Rey.
Javier Eraso scored Leganes’ first-ever goal at the Bernabeu with a fine curling effort in the first half and although Karim Benzema levelled soon after half-time, Gabriel headed a deserved winner.
Leganes lost the first leg 1-0, but secured their first win at the Bernabeu and a place in the semi-finals for the first time on away goals as the tie ended 2-2 on aggregate.
Zinedine Zidane made wholesale changes with the likes of Sergio Ramos, Karim Benzema, Isco, Marco Asensio and Mateo Kovacic returning to the starting line-up and Cristiano Ronaldo and Gareth Bale among those rested.
Real turned in an uninspired display in the first leg and quickly found themselves under pressure from a fired-up Leganes.
Claudio Beauvue’s brilliantly curled free-kick struck a post for the visitors in the fifth minute and soon after Darko Brasanac’s well-struck shot was saved in the bottom corner by Real goalkeeper Kiko Casilla.
Leganes threatened again, but the unmarked Gabriel headed straight at Casilla from a corner.
It got worse for the under-pressure Zidane’s side in the 31st minute when Eraso found himself in plenty of space and curled a stunning 25-yard shot into the top corner to put Leganes 1-0 up on the night and level the scores on aggregate.
Benzema just failed to connect with Isco’s cross as Real chased a quick response, but as the home fans began to get restless Leganes went close to doubling their advantage on the stroke of half-time when Beauvue’s overhead kick at the far post narrowly missed.
Real left the pitch to a chorus of boos at the interval, but two minutes after the restart – Zidane had made no half-time changes – the home side drew level.
Benzema ghosted on to Lucas Vazquez’s excellent through ball and clipped home a fine finish from a tight angle to put his side 2-1 ahead on aggregate.
Leganes’ first real lapse of the night was harshly punished, but the visitors regained the lead through Gabriel, whose thumping header from Eraso’s corner put his side ahead for the first time in the tie on the away goals rule and stunned the Bernabeu into silence.
Zidane sent on Luka Modric and Dani Carvajal for Marcos Llorente and Achraf Hakimi with 20 minutes to go and Borja Mayoral went on for Isco soon after.
The changes had little effect, but Real fashioned two golden chances in the 82nd minute as Benzema fired straight at Leganes goalkeeper Nereo Champagne and Mayoral headed another Vazquez cross inches wide.
Champagne tipped a Ramos header over the crossbar as the clock ticked down and Vazquez’s stoppage-time shot was blocked as Leganes held on for a famous victory.