Real Madrid overcame the absence of Cristiano Ronaldo and other regular starters Wednesday, coming from behind to defeat Leganes 3-1 Wednesday in a Spanish league match postponed from last year.
The result allowed the defending champions to regain third place from Valencia, but it did little to put Zinedine Zidane's team back in the title race as it still trails leader Barcelona by 14 points after 24 matches. Madrid is seven points behind second-place Atletico Madrid.
Less than a month ago, Leganes jolted Madrid into a crisis by eliminating the Spanish powerhouse from the quarterfinals of the Copa del Rey.
The hosts from southern Madrid went ahead less than 10 minutes into the match on Wednesday, but Madrid answered with first-half goals by Lucas Vazquez and Casemiro. Sergio Ramos sealed the victory by converting a 90th-minute penalty kick.
The league match was rescheduled from the 16th round because of Madrid's participation in the Club World Cup in December, a competition it won.
Only in its second season in the first division, Leganes had a promising start to the campaign but has struggled recently. It hasn't won in six matches and has lost four straight, dropping to 13th with 29 points.
Madrid has won four in a row, including 3-1 against Paris Saint-Germain in the last 16 of the Champions League last week.
Ronaldo, who scored twice against PSG and has 10 goals in his last six matches, was rested on Wednesday along with goalkeeper Keylor Navas. Marcelo, Tony Kroos and Luka Modric are trying to recover from injuries in time for next month's return match against PSG in Paris.
Leganes opened the scoring with a goal by Unai Bustinza six minutes into the match at Butarque Stadium. The defender dived in front of the ball as Madrid left back Theo Hernandez tried to clear it from near the goal line. The ball ricocheted off Bustinza's head and shoulder and went into the net.
Madrid equalized five minutes later with Vazquez's low shot into the far corner from inside the area after a through ball by Casemiro, and 20 minutes later it was the Brazilian defensive midfielder who found the net from close range after a pass by Vazquez.
Ramos scored from the penalty spot after Mateo Kovacic was pushed inside the area in the closing minutes.