Valentino Rossi took victory just ahead of Dani Pedrosa in a thrilling MotoGP at Estoril in Portugal.
Rossi had not won since the Dutch MotoGP in June
Italy's five-time world champion used all his experience to edge out Spaniard Pedrosa in an electrifying final few laps to take the win for Yamaha.
Championship leader Casey Stoner of Australia was third on the Ducati.
Rossi's fourth victory of the season, but first for more than two months, keeps the championship race alive going into next week's race in Japan.
With 100 points still up for grabs in the remaining four races, Stoner, who has won eight times this year, holds a 76-point lead over Rossi.
The 21-year-old Australian said: "I got third position and we've got to be pretty happy with that.
"Unfortunately in the race I had a problem with my clutch. It just kept coming in and going free, so there was no engine braking and I just kept running wide into turns. It was very difficult to manage.
"I was trying at the end to close it down but I just didn't have the drive or the feeling with the bike.
"I just needed a few tenths (of a second a lap) more to be able to get on the back of them but it just wasn't to be."
An emotional Rossi dedicated his fourth victory of the season to Colin McRae, the former world rally champion from Scotland who was killed in a helicopter crash on Saturday.
"I need to remember Colin McRae," Rossi told the BBC. "I dedicate to him this victory because he is one of my idols.
"It was a great, great battle with Dani. Today my Michelins (tyres) and my bike worked very well."
1. Valentino Rossi (Ita), Yamaha, 45 mins, 49.911 secs
2. Dani Pedrosa (Sp), Honda, 45:50.086
3. Casey Stoner (Aus), Ducati, 45:51.388
4. Nicky Hayden (US), Honda, 46:02.862
5. Marco Melandri (Ita), Honda, 46:07.254
6. John Hopkins (US), Suzuki, 46:08.768
7. Carlos Checa (Sp), Honda, 46:21.435
8. Toni Elias (Sp), Honda, 46:30.446
9. Loris Capirossi, (Ita), Ducati, 46:33.018
10. Colin Edwards, (US), Yamaha, 46:34.585
Overall Standings (after 14 of 18 races)
1. Casey Stoner 287 points
2. Valentino Rossi 211
3. Dani Pedrosa 188
4. John Hopkins 150
5. Chris Vermeulen 147
1. Alvaro Bautista (Sp), Aprilia, 43:56.458
2. Andrea Dovisioso (Ita), Honda, 44:00.825
3. Jorge Lorenzo (Sp), Aprilia, 44:02.606
1. Hector Faubel (Sp), Aprilia, 40:46.337
2. Gabor Talmacsi (Hun), Aprilia, 40:46.469
3. Pol Espargaro (Sp), Aprilia, 40:46.572.