Real took the honours in the Madrid derby, while Barcelona continued their incredible start to the season by thrashing Athletic Bilbao.
Real Madrid started the night in La Liga eight points adrift of their capital rivals in third place and were able to claim the victory they desperately needed with a 2-0 defeat of Atletico Madrid at the Santiago Bernabeu.
They took the lead in the 16th minute when Cristiano Ronaldo fired a trademark free-kick over the wall and past the despairing dive of Thibaut Courtois.
Atletico pushed for an equaliser but fell further behind on 66 minutes as Mesut Ozil drove home a fine finish after being played in by Ronaldo.
Lionel Messi hit his 83rd and 84th goals of the calendar year as Barcelona consolidated their position at the summit, six points clear of Atletico, with a 5-1 victory over Athletic Bilbao.
Two goals in three minutes - from Gerard Pique and a deflected Messi effort - midway through the opening 45 minutes put Barca firmly in the ascendancy and Adriano added a superb third in first-half stoppage time.
Cesc Fabregas notched a neat fourth soon after the break and, after Ibai Gomez had pulled a goal back with Athletic's first noteworthy attack of the match, Messi rounded things off with a brilliant fifth goal.
Messi's brace left the 25-year-old needing just one more goal to equal Gerd Muller's record of 85 in a calendar year, set in 1972.
Getafe moved level on points with Malaga in fourth thanks to Alberto Lopo's solitary goal 11 minutes into the second half.
Neither side hit top gear in a pedestrian opening period but the game came to life after Lopo nipped in between Eliseu and Willy Caballero to head home Pedro Leon's corner just after the break.
Real Sociedad moved into seventh in the Primera Division with a comprehensive 5-2 demolition of 10-man Valencia at the Mestalla.
Roberto Soldado's second-minute strike had given the hosts an early lead but they were never in control and were pegged back before half-time as Alberto de la Bella fired in an equaliser minutes after Jonas had seen a straight red card for lashing out at David Zurutuza.
Sociedad took control in the second period as further goals from Mikel Gonzalez, Diego Ifran, Imanol Agirretxe and Carlos Vela rendered Soldado's second of the evening meaningless.