Skipper Sergio Ramos scored twice as Real Madrid recovered from back-to-back defeats by edging past mid-table La Liga rivals Malaga at the Bernabeu.
Cristiano Ronaldo and Karim Benzema both missed clear chances, while Malaga’s Chory Castro hit the post, before centre-back Ramos planted in a free header from Luka Modric’s corner.
Ramos netted again shortly before half-time when he slid in another set-piece – despite appearing to stray offside following Toni Kroos’ delivery.
Malaga replied through Juanpi’s thumping 15-yard drive, but it was not enough to avoid a fifth straight defeat.
The 13th-placed visitors, who have now not won in eight, failed to build on their foothold in the game and rarely looked like stunning the home crowd with an equaliser.
Madrid looked likelier to kill the game off in the closing stages, Ronaldo hitting the base of the post with an angled drive.
However, they more than deserved to move four points clear of second-placed Sevilla, despite not adding a third.
It was a functional, if not vintage, display from Zinedine Zidane’s side, who saw a 40-match unbeaten run ended by successive losses at Sevilla and Celta Vigo.
Sevilla travel to bottom club Osasuna on Sunday (11:00 GMT) with Barcelona, a point further back in third place, go to ninth-placed Eibar (19:45).