Rayo Vallecano 1-0 Real Madrid
Real Madrid were stunned by La Liga’s bottom club Rayo Vallecano, who kept their slim hopes of survival alive.
It is the first time Real have lost to a team bottom of the league since 2004.
Boss Zinedine Zidane made eight changes to his team as he continues to experiment with his third-placed squad, who have little to play for.
Adrian Embarba scored the only goal for Rayo from a video assistant referee-awarded penalty following a Jesus Vallejo foul on Javi Guerra.
The referee did not initially award a penalty. Real broke and Gareth Bale had a shot saved before the referee viewed the incident on a screen and gave a spot-kick.
Had Bale scored, it would have been disallowed.
Embarba sent Thibaut Courtois, playing for the first time under Zidane, the wrong way in what proved to be the winner.
He is now Rayo’s joint second top scorer this season with four goals. Their main goalscorer Raul de Tomas was ineligible because he is on loan from Real.
Madrid minnows Vallecano – who had only won one of their previous 13 games – are six points adrift of safety with three games to go.