Valentino Rossi won his first MotoGP in 15 months with victory at his home track in San Marino.
The Yamaha rider finished ahead of team-mate Jorge Lorenzo with Honda’s Dani Pedrosa in third.
Championship leader Marc Marquez suffered an early crash and finished down the field in 15th. His overall lead was reduced to 74 points from 89.
Rossi’s win at Misano was the Italian’s 81st career victory and took his MotoGP points total beyond 5,000.
British riders Bradley Smith and Cal Crutchlow finished seventh and ninth respectively.
The Misano circuit is located near nine-times world champion Rossi’s home town of Tavullia.
His last win came at Assen in the Netherlands in June last year and the victory saw an end to Honda’s 100% winning record this season.
“It’s a really great win and with Marquez in such amazing form it’s not like it happens often,” said Rossi.
“It was the right moment and I took advantage of it, thanks to a Yamaha which was better than the Honda.”
Rossi, 35, had qualified third on the grid, behind Spain’s Lorenzo and Italy’s Andrea Iannone, with Marquez starting from the second row for the first time this season as he looked for his 12th win in 13 races.
Marquez and Rossi battled from the start, until the young Spaniard fell on lap 10.
He lost control of his bike with 19 laps to go with the machine slipping out from beneath him under braking.
“Winning was the main aim of the season and I did,” Rossi added.
“I knew I could do it and I continued to push and believe in it always, regardless of everything.
“I kept telling myself that it would happen one day – that Marquez wouldn’t be at 100% and I had to be ready.”
The next race is in Aragon, Spain, on 28 September.