Gareth Bale made up for the absence of Cristiano Ronaldo by scoring twice to inspire Real Madrid to come from two goals down and win 3-2 at Rayo Vallecano on Saturday.
Real managed to edge to the top of the table despite Ronaldo missing his first league game of the season with a muscle strain although they also suffered another scare before their Champions League semi-final next week with a suspected injury to Karim Benzema.
Real had found themselves two behind within 14 minutes as Adrian Embarba scored from close range in the seventh minute before Rayo's Venezuelan striker Miku pounced on more poor defending from the visitors.
Bale started the revival, heading in from a 35th minute corner before Zinedine Zidane's side drew level six minutes after the break through substitute Lucas Vazquez.
Welshman Bale then completed the comeback nine minutes from time, collecting a misplaced pass from a Rayo defender before powering the ball past goalkeeper Juan Carlos.
The victory put Real on top of La Liga on 81 points, but title rivals Atletico Madrid and Barcelona could surpass them after playing later on Saturday.
Real, who had not lost to Rayo Vallecano since 1997 and had thrashed their city neighbours 10-2 earlier this season, missed Ronaldo, who strained a muscle in the 3-0 win over Villarreal on Wednesday.
Still, the visitors nearly got off to a dream start as Bale hit the post in just the second minute, but Rayo soon imposed themselves with former Manchester United player Bebe setting up their first goal.
He took on Danilo and Pepe before rolling the ball across for Embarba to score from six yards out. Then a weak header from Raphael Varane allowed Miku to pounce.
Bale's header lifted them before the break but Benzema had to be substituted in the 42nd minute with a suspected injury, putting in doubt his chances of facing Manchester City on Tuesday in the Champions League semi-final first leg.
The Frenchman was replaced by Vazquez, who headed home Danilo's cross at the far post and it was Bale who had the final say, intercepting the ball and racing into the box down theleft flank to strike the winner.