|Lorenzo flies the flag ahead of compatriot Pedrosa [AFP]
Spaniard Jorge Lorenzo passed compatriot Dani Pedrosa on the last lap to win a thrilling Spanish MotoGP.
Pedrosa had led the field from pole position, but with two laps remaining Lorenzo caught up with him and after a gripping tussle he cut inside Pedrosa to cross the line first, half a second ahead.
World champion Valentino Rossi was third in Sunday’s race.
"I can't describe it," a soaking Lorenzo told Spanish television, after he had celebrated by running and jumping fully clothed into a lake at the circuit.
"It was one of my dreams to win at Jerez and to do it against someone like Dani, who made it very difficult, it's unbelievable."
Pedrosa made the most of first place on the grid to hold off an early charge from Rossi, who jumped from fourth to second at the first bend, and these two then pulled away from the rest of the pack.
Pedrosa has been having stability problems with his Honda and he struggled with some wobbles on bends but it looked like it was going to be a battle between him and Rossi, who was nursing a bruised shoulder.
But when Lorenzo passed Nicky Hayden to climb up to third with 18 laps to go, attention switched to the battle between second and third.
Lorenzo snuck inside his Yamaha team mate Rossi with six laps to go and then showed astonishing pace to catch Pedrosa with two laps remaining.
They almost crashed on one bend, and then actually came together in the last lap, but Lorenzo's aggressive tactics paid off when he barged through a couple of bends before the finish to be roared across the line by the 122,000 crowd.
American Hayden finished fourth ahead of Ducati teammate Casey Stoner of Australia.
Italian Andrea Dovizioso was sixth.