Cristiano Ronaldo scored his first LaLiga goal of the season to atone for an astonishing earlier miss and earn Real Madrid a hard-fought 2-1 win at Getafe.
Having missed the start of the season through suspension, Ronaldo had not found the net in his first three league appearances and his duck looked set to continue in a largely frustrating contest against their neighbours.
Zinedine Zidane's side took the lead when Karim Benzema capped off a counter-attack with a fine first-half finish.
But Getafe surprisingly levelled against the run of play 11 minutes into the second half as Jorge Molina continued his excellent run of form against Madrid.
Ronaldo was then presented with a golden chance to seal the points, only to somehow shoot wide from a yard out.
It looked as if that profligacy would prove costly, but the Portugal forward made amends by latching onto Isco's wonderful lofted ball over the top and lashing a half-volley beyond Vicente Guaita.
The win cuts the gap to leaders Barcelona to four points, though Luis Enrique's men could extend that back to seven with victory at Atletico Madrid later on Saturday.
Ronaldo almost opened the scoring in stunning fashion as he saw his half-volley kept out by a diving save from Guaita down to his right.
Getafe reduced Madrid to efforts from long-range for much of the first half, Ronaldo seeing a strike from the edge of the area comfortably saved by Guaita.
Benzema, who teed Ronaldo up for his earlier chance, then fired over the bar after a clever flick from his strike partner, but Getafe did not heed that warning as the Frenchman put Madrid ahead in the 39th minute.
The hosts wastefully gave the ball away from a free-kick and Madrid rapidly launched a counter-attack with the aid of a deflected pass into the path of Benzema, who fired into the bottom-left corner.
Madrid quickly set out to double their lead upon the restart and Getafe were very fortunate not to concede during a passage of play in which Ronaldo and Lucas Vazquez each could have scored before Marcelo saw an effort tipped over by Guaita.
But Zidane's men were pegged back just three minutes later in contentious fashion. Faycal Fajr got down the right and his low cross was turned home by Molina, though replays indicated the veteran striker was offside.
Ronaldo failed to hit the target with a free-kick before then inexplicably spurning an opportunity to settle the contest from point-blank range after a free-kick diverted into his path in the 73rd minute.
Theo Hernandez had the ball in the net but was correctly flagged for offside and Mauro Arambarri was unable to test Kiko Casilla, playing in place of the injured Keylor Navas, with an ambitious effort.
Getafe hearts were broken in the 85th minute, though, as Ronaldo returned to his usual form with a reminder of his finishing prowess to secure maximum points.