MADRID — 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 it 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, Madrid was stunned 2-1 by relegation-threatened Girona at Santiago Bernabeu Stadium on Sunday, and is 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, which hadn't won in 13 matches in all competitions and was 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. Its last win in all competitions had been on Dec. 5 against Alaves in the Copa del Rey.
"It's a well-deserved prize after several matches without being able to win," Girona coach Eusebio Sacristan said. "We deserved the victory after the way we played in the second half."
Girona, which moved to 15th, had lost twice to Madrid in the quarterfinals of the Copa del Rey last month, being outscored 7-3. It eliminated Atletico Madrid in the round of 16 on away goals after consecutive draws.
The surprise loss dropped Madrid to third place after the weekend matches. Atletico Madrid 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.
Madrid had won seven of its 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.
Girona had a golden chance to equalize about five minutes before the penalty, when Aleix Garcia's close-range shot went over the crossbar. The visitors moved in front with a 75th-minute header by Portu after Madrid goalkeeper Thibaut Courtois initially saved a shot by Anthony Lozano.
Portu had hit the post a few minutes earlier with a booming shot from inside the area.
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.
Villarreal ended a 10-game winless streak in the league with a 3-0 rout of Sevilla, moving closer to leaving the relegation zone. It's now 18th in the 20-team standings, a point from safety.
Sevilla had its winless run extended to three league games, keeping its fourth place but seeing several other teams move closer to the final Champions League birth.
Valencia, which has drawn three in a row in the league, was held to a 0-0 home draw against Espanyol, and dropped to ninth place.
Eighth-placed Real Betis, winless in four matches in all competitions, drew 1-1 at home with sixth-placed Alaves.
More AP soccer: https://apnews.com/apf-Soccer and https://twitter.com/AP_Sports
Tales Azzoni on Twitter: http://twitter.com/tazzoni