Barcelona - Valentino Rossi gave his MotoGP world title prospects a massive boost with success in the Grand Prix of Catalonia on Sunday at a sombre Montmelo circuit reeling from the tragic death of Luis Salom.
Rossi got the better of a gripping dogfight in the closing laps with pole sitter Marc Marquez, who crossed in second to take the championship lead.
Jorge Lorenzo lined up leading the MotoGP standings but came away pointless after being wiped out by Andrea Iannone.
Marquez leads the championship after this seventh leg of the season on 125 points from Lorenzo on 115 points and Rossi now in third on 103 points.
Salom suffered fatal injuries in a crash in practice for the Moto2 Grand Prix won earlier on Sunday by Johann Zarco, who like Rossi and Moto3 winner Jorge Navarro dedicated his win to Salom.
Salom was honoured by a minute's silence before racing.
The stricken Spaniard was only eight years old when Rossi notched up his first world championship win in 2000.
Sixteen years later the 37-year-old Italian veteran posted his 114th career win and 88th in the top division after employing all his skill, nerve and experience to shake off a determined Marquez.
Given the difficult circumstances, there was a touching moment when the riders dismounted as Rossi and Marquez shook hands, drawing a line under their bitter rivalry from 2015.
"This is a great, great victory, one of the best of my career. It is for Salom and for his family," said the Yamaha star.
By lap five Rossi had fought his way up to second from fifth on the grid, and he then pushed past teammate Lorenzo, who slipped back to fourth.
Lorenzo's hopes of a third straight win after Le Mans and Italy disappeared when an impetuous Iannone tried an ill-fated and dangerous overtaking move with nine laps left.
Lorenzo was clearly furious at the Ducati rider's antics.
As the defending world champion trudged back to the stands, Marquez was in hot pursuit of his arch rival Rossi.
He nudged his Honda up the inside of Rossi's bike to take a look with five laps remaining, only for Rossi to close the door.
Two laps later Marquez muscled his way past, and it was nip and tuck between the pair until Rossi regained the lead to pull away and take the win by over two and a half seconds.
"I knew it would be hard, I was worried because when I was in front I was pushing a lot, but not enough to escape from Marc," said Rossi.
Marquez said: "Of course this battle is for Salom."
Rossi won his seventh race here and first since 2009. He will be encouraged by the fact that 15 of the last 19 Catalonia winners have gone on to clinch the title.