Cristiano Ronaldo rescued Real Madrid from another stumble at home when he scored after his penalty kick was saved to secure a 3-2 win over Malaga in the Spanish league on Saturday.
Ronaldo got the 75th-minute winner by knocking in the ball following Malaga goalkeeper Roberto Jimenez's save. Jimenez denied him on two clear chances in the first half before Ronaldo finally got his second league goal in 13 rounds.
The win put Madrid seven points behind leader Barcelona, which faces an important trip to second-place Valencia on Sunday.
Madrid coach Zinedine Zidane blamed his team's passing mistakes on why the defending Liga champions twice lost the lead to a team in the relegation zone, before finally taking control.
"We knew that possession of the ball is a weapon that we have, and we lost the ball several times," Zidane said. "In the end ... we have to focus on the result since we know that we did some things well and that there were some other things that didn't go as we would have liked."
Karim Benzema also netted just his second league goal to put Madrid ahead in the ninth when he nodded in a rebound of Ronaldo's header that came off the crossbar.
Malaga hadn't scored a goal in all six of its previous league games away from home, but it leveled through Diego Rolan in the 18th by capitalizing on an error by Madrid's Toni Kroos. The Germany midfielder blundered with a back pass near his own area, and Sergio "Keko" Gontan pounced to send in a cross for unmarked Rolan to control with his chest and fire home.
Casemiro headed Madrid ahead again and Malaga forward Gonzalo "Chory" Castro made it 2-2 with a long-range strike.
Madrid was heading to another costly slip at Santiago Bernabeu Stadium - where it failed to win the first three league matches - until substitute Luka Modric was tripped by Luis Hernandez in the area. That allowed Ronaldo to step up and take what turned out to be the winner.
Malaga lost defender Juan Carlos Perez to a left knee injury early.
"I believe we deserved much more (from the match)," said Malaga coach Michel Gonzalez, a former Madrid player.
"We are all worried about Juan Carlos' knee because he is in a lot of pain, and that hurts us more than the loss."
Kevin Gameiro scored twice and played a direct part in three more goals to lead Atletico Madrid's 5-0 rout at Levante.
Atletico's biggest win of the season allowed it to move ahead of Real Madrid and into third place on goal difference.
Antoine Griezmann also scored twice.
Real Betis salvaged a 2-2 draw at home with Girona after a wild finish that included goals from both teams in the dying moments.
Girona appeared set to get the win after Cristian "Portu" Portugues netted his second goal four minutes into stoppage time.
But just after the restart, Betis substitute Cristian Tello controlled a long ball with his chest, dribbled past a defender and slotted in a strike on the last kick of the match.
Ten-man Eibar dealt Alaves its 11th loss of the season after winning 2-1 on the road in a derby of small Basque Country clubs.
Charles scored Eibar's second goal then received a direct red card for shoving the head of an Alaves player in the 83rd.