Jeremy Mathieu and Daniel Parejo were on target for the visitors to seriously damage Carlo Ancelotti's side's chances of winning the league this season
Real Madrid failed to capitalise on slip-ups by their rivals as Valencia applied further drama to La Liga’s title race with a 2-2 draw in the Santiago Bernabeu.
Following Barcelona’s draw with Getafe on Saturday and a 2-0 defeat for leaders Atletico Madrid at Levante earlier on Sunday, Carlo Ancelotti’s team looked in pole position for the title.
But Valencia had not read that script and goals from Jeremy Mathieu and former Real youth product Daniel Parejo either side of Sergio Ramos’ equaliser looked to have handed Juan Antonio Pizzi’s side a famous triumph.
Visiting goalkeeper Diego Alves was magnificent throughout, routinely thwarting Cristiano Ronaldo, but the Portuguese finally got the better of him in stoppage time to earn a point.
Despite rescuing a draw, it is Real's local rivals Atletico who appear best-placed. Victory in their final two matches - including the much-anticipated season-ending encounter with Barca at Camp Nou - will hand them the title.
For Valencia, the performance provided a tonic to Thursday's last-gasp Europa League semi-final elimination at the hands of Sevilla.
Ancelotti’s men quickly hit their stride, Ronaldo beginning his game-long duel with Alves as early as the third minute.
As Madrid failed to build on their start, Parejo found himself unmarked on the end of Sofiane Feghouli's wonderful right-wing cross 16 minutes in, but Diego Lopez tipped his header onto the crossbar.
It was Alves' turn to impress again after 26 minutes as Ronaldo stormed past Ricardo Costa, only to see his strike palmed around the post.
Valencia served further warning of their intentions when Paco Alcacer failed to get a decisive touch on Eduardo Vargas' low cross and, after Alves thwarted Ronaldo once more, they claimed a 44th-minute advantage.
Lopez was at full stretch in touching Feghouli's strike over the bar but erred by staying on his line from the resulting corner and Mathieu scored, the ball ultimately finding the net via his shoulder.
Ancelotti sent Angel di Maria on at the interval and the Argentina midfielder's energy immediately boosted the hosts.
After saving from Di Maria, Alves again kept out Ronaldo but, after Raphael Varane spurned a set-piece chance, Real’s pressure finally told.
Ramos was still up from an earlier attack and enjoyed a tap-in when Ronaldo headed across goal in the 59th minute - netting for the fourth time in Real's last three outings.
With the game seemingly at their mercy, Real allowed the action to drift and, following a scrappy passage of play, Valencia poured forwards, Parejo steering clinically into the corner from Feghouli's pass.
Ronaldo sought an instant response from close range but Alves again excelled, and he tormented the Ballon d'Or winner with another stellar stop from a trademark free-kick.
The Portugal captain's frustrations appeared to have gotten the better of him in the last 10 minutes as he sent a free header wide and had a penalty claim rejected.
But Real's talisman salvaged a point in stoppage time. Ronaldo produced a moment of genius with a remarkable back-heel volley from Di Maria's cross, though he should have secured a stunning triumph even deeper into injury time, heading wide to keep Ancelotti's men second-best in the title race.