Lowly Girona stunned Real Madrid as they came from a goal down to win 2-1 at the Bernabeu on Sunday in a game that saw Sergio Ramos sent off for two bookings.
But there's relief for Madrid as Ramos will Casablanca gave Madrid a half-time lead, but Cristhian Stuani leaned from the penalty spot and Cristian Portu led home a shock winner. For the side that started the day in the 17th place
Girona made a positive start, putting together a neat move when Porto and Alex Granell linked, but the final ball in the Madrid area just failed to find Stuani.
Madrid flickered In life, Toni Kroos served as a warning sign when his free kick was cleared by Douglas Luiz.
With a little over a quarter of an hour gone, Kroos found Lucas Vazquez, whose shot brought a fine stop from Yassine Bounou, but Girona answered and Stuani drew a go od save from Thibaut Courtois
And Kroos was again involved as Madrid took the lead after 25 minutes, his cross headed by powerfully home by Casemiro.
Lucas and Alvaro Odriozola combined to look for Karim Benzema, who was unable to reach a low cross, before Alex Granell smashed an effort wide for Girona.
Benzema was close to doubling Madrid's lead As a half-time approached, Bounou saved his rising shot, and he should have done so early in the second half just to head Marco Asensio's cross wide when unmarked inside the six-yard box.
Madrid coach Santiago Solari made his first change just before the hour, bringing Vinicius Jr. For the Lucas was shortly before the hour, but soon afterwards his side were thankful for a bad Girona miss.
The visitors looked certain to be equalized when Courtois saved from Anthony Lozano but Aleix Garcia, from close range, somehow lifted the ball over the top
But they were level after 64 minutes when Ramos handled Garcia shot and Stuani beat Courtois from the penalty spot, Ramos going into the book.
Vinicius Jr. shot over as Madrid looked to regain their advantage, but things almost got worse for the home side after 71 minutes when Girona's Porto smacked a shot against the post.
And they got worse with a quarter of a hour remaining as visitors went in front, Courtois parrying Lozano's shot and Portu diving to head the rebound past him.
Vinicius Jr. saw the curler going wide of the post post time began to run for Madrid, substitute Gareth Bale then thwarted by Bounou
In the closing moments, a high boot from Ramos deep inside the Girona penalty area brought the second yellow and His 25th red card for Madrid and there was still time for the keeper of Courtois, up for a corner, to head narrowly wide.