Playing his first match since his World Cup hopes were dashed by an injury, Karim Benzema came the rescue of Real Madrid with a pair of late goals to snatch a 2-0 victory at 10-man Valladolid.
Benzema had a subdued showing in his first competitive match since November 2 following injuries that had limited his availability for his club and finally sidelined him for his France at football's elite competition.
But the Ballon d'Or winner came through in the final minutes on Friday to give Carlo Ancelotti's side the three points it needed to provisionally move to the top of the Spanish league standings.
Madrid also relied on goalkeeper Thibaut Courtois to keep the score deadlocked as it struggled to create chances in its first game since the league paused for seven weeks for the tournament in Qatar.
Valladolid defended well and threatened on the break at its Jos Zorrilla stadium until the game finally swung in Madrid's favour when the video assistant referee spotted a handball in the area by defender Javi Sánchez.
Benzema stepped up and coolly slotted his penalty kick into the left corner as goalkeeper Jordi Masip fell the other way to grab the lead in the 83rd minute.
Valladolid's chances of hunting for a late equaliser were hurt when striker Sergio Len, one of its most incisive players, was shown a direct red card apparently for using inappropriate language while protesting the penalty decision.
Benzema then got his brace in the 89th after a pass by substitute Eduardo Camavinga.
"Benzema played very well given that he had barely played in the last three months," Courtois said.
"Maybe he was lacking a bit of pace. I bet the Karim of last year would have scored even more goals, but it is good for him to get this double."
Before Benzema put Madrid ahead, Courtois made two great saves to deny Len and midfielder lvaro Aguado. Courtois used a one-handed diving save to stop Aguado's long-range strike in the first half. He then got low to turn back Len's header in the 68th.
"Courtois's saves were decisive," said Valladolid coach Pacheta Martín, whose team slid into 15th place.
Madrid moved one point ahead of Barcelona at the top of the standings before Xavi Hernandez's side plays a derby against Espanyol on Saturday.
Before kickoff, a moment of silence was held in memory of Brazil great Pele, who died on Thursday. Ronaldo, the former Brazil and Madrid star and the current owner of Valladolid, stood alongside Real Madrid president Florentino Prez in the stands during the tribute. Brazil forward Vincius Junior closed his eyes and lifted his head upwards in midfield with the other players.
Sevilla remained in the relegation zone after a 1-1 draw at Celta Vigo.
Sevilla coach Jorge Sampaoli overhauled his attacking scheme after playmaker Isco Alarcn, who had been used as a false nine before the World Cup break, left the club by mutual agreement last week. In his place, Sampaoli started his two big strikers, Youssef En-Nesyri and Rafa Mir.
Celta's Gabri Veiga chipped Morocco goalkeeper Yassine Bounou in the 33rd after Iago Aspas met his run with a perfectly weighted pass after Veiga had recovered the ball. It was the 20-year-old Veiga's fourth goal of the season.
After Sevilla failed to generate scoring chances in the first half, Sampaoli sent on Erik Lamela for En-Nesyri at halftime.
Monents after Celta's goalkeeper pushed Lamela's shot onto the post, Kike Salas headed in the resulting corner kick to level the score in the 54th.
Sevilla finished with 10 men after Jos Carmona was shown a second yellow card in the 86th.
Argentina defender and world champion Marcos Acuna started for Sevilla.
Borja Mayoral struck twice in the second half to help earn Getafe to a 2-0 win over Mallorca.
Lucas Perez's late goal salvaged Cadiz a 1-1 draw at home with Almera.