Los Blancos knew that only victory would guarantee the defense of their Liga crown for one more matchday, but the visitors had no intention of following the script, taking the lead in the eighth minute through Oscar Gonzalez.
An own goal from Marc Valiente and a Ronaldo header turned the game around just after the half-hour mark, but Javi Guerra restored parity within moments during a chance-laden half for both sides.
Kaka quickly drilled Madrid into the lead after the restart, before Ronaldo nodded in his second in the 70th minute to seemingly seal the points - but a stunner from Sastre with three minutes to go ensured a nervy end to the game for the hosts.
The Brazilian was handed a rare start by Jose Mourinho, but with Sergio Ramos injured and Raul Albiol suspended, Ricardo Carvalho made a rare appearance in the center of defense.
And the Portuguese defender would show his rustiness with eight minutes gone. He failed to read an admittedly poor pass from Sami Khedira, but Oscar did not care who was to blame, running onto the ball and slotting home neatly.
Madrid nearly responded three times in three minutes, as Angel Di Maria, Luka Modric and Kaka flashed openings off target within seconds of each other.
Though Valladolid did not lack confidence, Madrid was the superior side, and when Kaka forced an excellent save from Jaimie from range, it seemed to be only a matter of time before their pressure would tell.
And true to form Madrid equalized on the next play, albeit in fortuitous fashion. Di Maria weaved his way into space and took aim, but it was a wicked deflection off Valiente that would be the undoing of Jamie.
The home side were in no mood to take their foot off the gas. Almost instantly, Ronaldo drilled a free kick narrowly wide, before Pepe forced a reflex save out of Jamie with a bullet header from a corner.
And just before the half-hour mark, Madrid took the lead. Di Maria’s in-swinging cross was guided towards the far corner expertly by the head of Ronaldo, who had stolen into an inch of space.
But just when the floodgates seemed to be opened, Valladolid put another spanner in the works. Oscar broke free and slid an incisive ball across the face of goal where Guerra, falling over, still managed to bundle home.
The action came thick and fast right up until the half-time whistle. Jamie stood tall again to deny Ronaldo and Benzema had a goal disallowed, before the Portuguese crashed a spectacular free-kick off the crossbar with a thud.
Madrid took the lead for the second time four minutes after the restart. Benzema did just enough to pick out Kaka on the left, and the Brazilian did not hesitate to power the ball into the far side of the goal.
Ronaldo planted a header over the bar from close as the hosts began to settle in, with Valladolid’s attacking threat seemingly confined to a relic of the first half.
And Ronaldo would not miss with his head again, rising highest to power Mesut Ozil’s corner into the far side with 20 minutes remaining.
By that point the result seemed in little doubt, but Diego Lopez still had to be alert to tip over an audacious effort from Oscar from near the halfway line.
However, in the 87th minute, substitute Sastre ripped an unstoppable 25-yard volley into the back of the net from a rebound off a corner to throw the cat right back amongst the pigeons.
But the visitors could not go that extra mile, as Madrid managed to see out the remaining minutes to keep a modicum of pride intact.