With a home loss to a team that hadn't won in more than two months, Real Madrid wasted all the hard work that had allowed them to move closer to Barcelona at the top of the Spanish league.
After winning five in a row to cut Barcelona's lead to six points, Real were stunned 2-1 by relegation-threatened Girona at Santiago Bernabeu Stadium on Sunday, and are now nine points behind its rival in third.
"It's a shame that we let these points slip by," Real Madrid coach Santiago Solari said. "We were coming off a good run and we were getting closer to the lead."
Girona, who hadn't won in 13 matches in all competitions and were coming off six straight losses, scored two second-half goals to reverse a 1-0 halftime deficit.
The Catalan club hadn't won in the league since November and had entered the weekend one point above the relegation zone. Their last win in all competitions had been on Dec. 5 against Alaves in the Copa del Rey.
The surprise loss dropped Real to third place after the weekend matches. City rivals Atletico moved to second after defeating Rayo Vallecano 1-0 on Saturday to halt a two-game losing streak in the league. Barcelona edged Valladolid 1-0 with a penalty kick converted by Lionel Messi at Camp Nou Stadium to end a three-game winless run in all competitions.
Real had won seven of their last eight matches in all competitions, with the only setback a 1-1 draw at Camp Nou in the first leg of the Copa del Rey semifinals.
Solari left Vinicius Junior and Gareth Bale on the bench after they started midweek in the 2-1 win at Ajax in the round of 16 of the Champions League. Marcelo, who had been left out of the Ajax game, played from the beginning at the Bernabeu.
Casemiro opened the scoring with a firm header from near the penalty spot in the 25th minute after a cross by Toni Kroos, and Girona equalized with a penalty kick converted by Cristhian Stuani in the 65th after a handball by Sergio Ramos inside the area.
The visitors moved in front with a 75th-minute header by Portu after Madrid goalkeeper Thibaut Courtois initially saved a shot by Anthony Lozano.
Solari put on Vinicius Junior and Bale in the second half and Madrid pressed to try to reverse the deficit. Courtois made it to the area in a last-gasp attempt, but couldn't get enough on his header, sending the ball just wide of the post.
Ramos was sent off in the 90th after receiving a second yellow card. (AFP)