(CNN) -- Spain's Jorge Lorenzo won a thrilling Spanish MotoGP as he overtook compatriot Dani Pedrosa on the final lap at Jerez on Sunday.
World champion Valentino Rossi, who won the opening round in Qatar, finished third but loses his early lead in the title standings to Yamaha teammate Lorenzo.
Italian ace Rossi moved through from fourth place to second until he was passed by the charging Lorenzo with six laps remaining.
Polesitter Pedrosa had led from the start on his Honda, but then came under pressure from Lorenzo in a superb finale.
The pressure finally told as Lorenzo got past to take the checkered flag by just over half a second.
"It's the greatest victory of my career," Lorenzo told the official MotoGP Web site after his sixth win in the elite category.
Rossi said he was still troubled by a recent shoulder injury and lost grip on his tires as the race went on.
"I had a good start and for the first 10 laps I felt good, then my tires started to slide and from then on I was just hanging on," he said.
Ducati's American star Nicky Hayden finished fourth, just ahead of teammate Casey Stoner of Australia with Italian Andrea Dovizioso taking sixth place.
Earlier, Spain's Toni Elías won the Moto2 class race ahead of Shoya Tomizawa and Thomas Luthi and Derbi rider Pol Espargaro led a Spanish sweep of the 125cc category ahead of Aprilia duo Nicolas Terol and Esteve Rabat.