Match ends, Rayo Vallecano 2, Real Madrid 3.
Real Madrid survived a second-half fightback by bottom side Rayo Vallecano to hold on to a nervy win.
A Cristiano Ronaldo double and Karim Benzema's goal put them 3-0 ahead on 48 minutes before two Jonathan Viera penalties in the space of three minutes left Real hanging on.
Visiting keeper Diego Lopez kept his side ahead as he tipped Alberto Bueno's shot on to the post on 65 minutes.
Real remain in third, six points behind leaders Barcelona.
They are two points behind their Madrid rivals Atletico, who play their game in hand against Athletic Bilbao on Sunday.
It was a stirring performance from Rayo in front of their vocal fans and overshadowed the contribution of Real's world-record signing Gareth Bale, whose start in Madrid has been disrupted by injury.
The 100 million euro Wales winger followed up Wednesday's two goals and two assists in the 7-3 win at home to Sevilla with a cross for Benzema's headed second goal, before squaring for Ronaldo to complete his brace soon after the break.
The Portuguese had given the visitors a third-minute lead, with his tally now 33 goals in as many La Liga matches in 2013.
But, seemingly cruising, Carlo Ancelotti's men were stunned by the hosts' brave second-half efforts as Viera scored from the spot on 53 and 55 minutes following fouls by Pepe and Marcelo.
The hosts were earlier denied a first-half equaliser when midfielder Iago Falque, who is on loan from Tottenham, arrived at the far post to bundle into the Real net - but officials spotted that the ball hit offside team-mate Viera before going past Lopez.
Barcelona top La Liga after Alexis Sanchez's second-half winner helped beat neighbours Espanyol 1-0 and stretch their unbeaten La Liga start to a 12th game on Saturday.
- 2Román TrigueroBooked at 77mins
- 3Martínez GarcíaBooked at 59mins
- 21ArbillaSubstituted forLarriveyat 51'minutes
- 10TrashorrasBooked at 88mins
- 19Viera Ramos
- 8González MoralesSubstituted forBuenoat 42'minutes
- 24FalquéSubstituted forEmbarbaat 69'minutes
- 15CarvajalBooked at 6minsSubstituted forArbeloaat 59'minutes
- 5da Silva CoentrãoSubstituted forMarceloat 45'minutesBooked at 71mins
- 14AlonsoBooked at 11minsSubstituted forIllarramendiat 45'minutes
- 19ModricBooked at 90mins
- 22Di MaríaBooked at 62mins
- 7Cristiano Ronaldo
- 20Rodríguez Ruiz
- Alfonso Álvarez Izquierdo
- Shots on Target
Second Half ends, Rayo Vallecano 2, Real Madrid 3.
Luka Modric (Real Madrid) is shown the yellow card.
Attempt missed. Tito (Rayo Vallecano) header from the centre of the box is close, but misses to the left. Assisted by Nacho.
Foul by Adrián Embarba (Rayo Vallecano).
Luka Modric (Real Madrid) wins a free kick in the defensive half.
Roberto Trashorras (Rayo Vallecano) is shown the yellow card for a bad foul.
Foul by Roberto Trashorras (Rayo Vallecano).
Ángel Di María (Real Madrid) wins a free kick in the defensive half.
Delay over. They are ready to continue.
Delay in match Lass (Rayo Vallecano) because of an injury.
Nacho (Rayo Vallecano) wins a free kick in the defensive half.
Foul by Sergio Ramos (Real Madrid).
Corner, Real Madrid. Conceded by Rubén Martínez.
Attempt saved. Cristiano Ronaldo (Real Madrid) left footed shot from the centre of the box is saved in the bottom right corner.
Attempt saved. Cristiano Ronaldo (Real Madrid) right footed shot from the right side of the box is saved in the bottom left corner. Assisted by Gareth Bale.
Alberto Bueno (Rayo Vallecano) wins a free kick in the attacking half.
Foul by Asier Illarramendi (Real Madrid).
Attempt missed. Alejandro Gálvez (Rayo Vallecano) right footed shot from more than 35 yards misses to the left.
Attempt missed. Saúl Ñíguez (Rayo Vallecano) left footed shot from the centre of the box misses to the right.