Toni Kroos scored an impressive volley as Real Madrid beat Cadiz 2-1 to cut the gap on La Liga leaders Barcelona to two points on Thursday.
In the last league match before the break for the Qatar World Cup, Carlo Ancelotti's side were playing catch-up on their bitter rivals, who beat Osasuna on Tuesday.
The match threatened to turn ugly at times, with Cadiz repeatedly fouling Madrid winger Vinicius Junior, but Madrid got the points they needed thanks to Eder Militao's header and then Kroos's stunning strike.
Lucas Perez pulled one back for Cadiz in the final stages, ensuring second-place Madrid have not kept a clean sheet at home in La Liga this season and have conceded in seven consecutive league matches.
"We had a good game apart from the last 10 minutes," Kroos told DAZN.
"We had chances but suffered a bit with the goal we conceded unnecessarily. I think we had a good game."
Madrid were without striker Karim Benzema after he was unable to train on Wednesday, but he has been included in France's World Cup squad.
Without the Ballon d'Or winner, Madrid lacked sheen in attack, and perhaps some minds had started to turn to the upcoming tournament in Qatar.
Kroos's hadn't, though, lost focus and with an assist and his goal, he secured the victory for Los Blancos.
- Cutting the gap -
Pacha Espino's long-range strike clipped the top of the crossbar for the visitors, but they had few chances of note before Madrid opened the scoring.
Militao headed home Kroos's cross in the 40th minute, doing well to stay fractionally onside and escape any defensive attention after a corner was partially cleared.
The only other action in the first half came in the form of a bout of pushing and shoving between both teams, with Vinicius squaring up to defender Fali, who had hit Rodrygo with his arm off the ball.
"They defend in their manner. I think we have to be a bit calmer and concentrate more on playing football," added Kroos.
"If we react then they make us play their game. That's what they want, wasting time with each argument. I prefer to stay out of it and play football, because we are better."
Rodrygo was angry after the clash, in which Fali's swing at him appeared intentional.
"I don't think it's (just) an incident, he did it on purpose, he looked at me and he hit me," Rodrygo told DAZN.
"It's shameful because later he told me he didn't do anything. I don't know why VAR is even there."
The second half meandered until former Germany international Kroos brought fans to their feet with a special strike after 70 minutes, volleying home from outside the area after a cross deflected into his path.
The third should have arrived soon after but Luka Modric missed a sitter with the goal gaping after Vinicius cut the ball back in the box.
Barely able to believe he had missed, the Santiago Bernabeu chanted Modric's name. After so many years of immaculate service, the veteran Croatian midfielder could be forgiven this time.
"I told him it's just as well the Croatia squad had been announced already," joked Ancelotti on DAZN.
"We could have scored the third, it was quite simple, and then after that you suffer a bit, they score against you, but in the end we got three important points."
Thibaut Courtois spilled a shot he should have dealt with better and Perez rammed home to give Cadiz hope in the final stages.
Espino might have levelled for the visitors, 19th, in the 93rd minute but headed over from close range as Madrid held out.
Earlier, Valencia beat Real Betis 3-0, with Andre Almeida scoring an excellent free-kick at a rainy Mestalla and Hugo Guillamon adding the second from the penalty spot.
Justin Kluivert netted the third in stoppage time to round off an impressive win for the hosts, who climb to 10th.
Betis, who finished with 10 men after Edgar Gonzalez was dismissed, could have moved third with a win but instead sit sixth.
Rayo Vallecano drew 0-0 at home against Celta Vigo.