Rossi's faith in the front of his M1 helped him outbrake Stoner into turn one with four laps to go, and he exploited all of his braking advantage to defend the position at the same place a lap later. However, Rossi wasn't able to shake the #27 and as the penultimate lap began, Stoner drilled his Desmosedici's throttle out of the final turn and made sure he was ahead into turn one.
Rossi crawled all over the Australian for the next two laps, rarely more than a tenth behind, but Casey again proved completely unshakeable in the face of such pressure and Rossi - also on the limit - simply had no answer.
Stoner crossed the finish line just 0.069secs ahead to build his championship lead back up to 14 points after seven rounds, but the psychological gain was far greater. Catalunya is one of Rossi's favourite tracks and he has been exuding confidence in his bike and tyres all weekend - only to have victory snatched away from him.
Perhaps it wasn't such a big surprise - for the last nine MotoGP races the rider starting on pole position has failed to win, an all-time record.
Home hero Pedrosa finished just 0.39sesc from victory, but in reality was little more than a high speed spectator - the Repsol Honda rider being perfectly placed to pick up the pieces of any incident, but unable to go on the offensive. Dani has now gone a year without a victory and will hope to repeat his 2006 success next time out at Donington Park.
Hopkins finished an untroubled fourth, while de Puniet produced a brave ride to a MotoGP best of fifth despite his badly injured knee. Stoner's team-mate Loris Capirossi
climbed up from a disastrous 17th on the grid to finish 1.5secs behind the Frenchman with Suzuki's Chris Vermeulen
in turn a fraction from the Italian's rear wheel at the line.
Alex Barros, who beat Stoner to third last weekend, was eighth on the d'Antin Ducati, while Marco Melandri
brought his Gresini Honda home in a forgettable ninth. Team-mate Toni Elias
saw his home hopes end when his RC212V's engine failed while holding sixth on lap 15, making the aggressive Spaniard the only retirement.
While their team-mates stood on the podium, Colin Edwards
and world champion Nicky Hayden
faded from sixth and seventh on the grid to claim 10th (Edwards) and 11th (Hayden) at the flag.
Catalan Grand Prix:
5. de Puniet
16. Kenny Roberts
18. Kurtis Roberts