Valentino Rossi extended his lead over Jorge Lorenzo in the championship standings to 14 points after edging out his team-mate to win the German MotoGP.
The Yamaha duo were involved in a cat-and-mouse duel but Rossi pounced with two laps left to win at Sachsenring by nine-hundredths of a second.
Lorenzo had to settle for second, with Dani Pedrosa third ahead of Casey Stoner, who had tyre problems.
Britain's James Toseland came home in 10th place.
Rossi, who claimed his 101st victory, was thrilled to have held on for such an important victory over his closest rival, which also saw him equal Giacomo Agostini's record of 159 podium finishes.
"It was a great race. I made a good start and had to fight at the beginning with Casey which was funny," he told BBC Sport.
"But our two Yamahas worked very well and it was another great battle with Jorge. It was fantastic, we enjoyed it, and it was perfect for me.
"I braked so deep on that corner [to overtake Lorenzo]. I didn't make a mistake at a crucial point and it was an important victory for the championship."
Rossi led from pole position on an eventful first lap which saw Randy de Puniet crash out of third position following a fine start.
Stoner had worked his way past Pedrosa before taking over the lead from Rossi on lap six as the four main riders in the championship pulled clear of the field.
Rossi delighted after German win
Stoner, who has been suffering recently with anaemia and gastritis, seemed a rider rejuvenated but it soon became clear he was holding up the Yamaha duo, allowing Pedrosa to keep in touch.
Rossi and Lorenzo both got past the Australian and that left the team-mates with a third of the 30 laps remaining to battle it out.
With five laps to go, Lorenzo took over the lead into turn one but Rossi managed to return the compliment with two laps remaining, and held off the Spaniard's attempts at a late challenge.
Afterwards, Lorenzo admitted he had mistimed his overtake.
"I made a bit of a mistake because I thought there were a few more laps left when I passed him," he said.
"I hoped to overtake him and then try to pull away but it didn't work out.
"Of course I'm disappointed to lose another very close race, it is always sad but I know that we are capable of fighting with him and considering his experience this is something I must be proud of."
In the 125cc race, championship leader Julian Simon headed an all-Spanish top five, coming home ahead of Sergio Gadea and Joan Olive.
Briton Bradley Smith's 100% points-scoring record for the season ended after he crashed twice early on and compatriot Scott Redding retired with mechanical problems, but Danny Webb finished in eighth place
And a rain-shortened 250cc race was won by Italy's Marco Simoncelli, ahead of Spanish duo Alex Debon and Alvaro Bautista.
German MotoGP result:
1 V Rossi (It) Fiat Yamaha 41:21.769 2 J Lorenzo (Sp) Fiat Yamaha 41:21.868 3 D Pedrosa (Sp) Honda 41:24.668 4 C Stoner (Aus) Ducati 41:31.995 5 A de Angelis (SMR) Honda 41:43.291 6 T Elias (Spn) San Carlo Honda 41:52.621 7 M Melandri (It) Kawasaki 41:53.070 8 N Hayden (US) Ducati 41:53.495 9 C Edwards (US) Tech 3 Yamaha 41:54.634 10 J Toseland (GB) Tech 3 Yamaha 42:05.695 11 L Capirossi (It) Suzuki 42:19.144 12 N Canepa (Ita) Pramac Racing 42:22.308 13 C Vermeuluen (Aus) Suzuki 42:25.414 14 M Kallio (Fin) Ducati 42:25.924 15 G Talmacsi (Hng) Scot Racing + 1 lap
Championship standings:
1 V Rossi (Ita) Yamaha 176 points 2 J Lorenzo (Spn) Yamaha 162 3 C Stoner (Aus) Ducati 148 4 D Pedrosa (Spn) Honda 108 5 C Edwards (USA) Yamaha 83 6 M Melandri (Ita) Kawasaki 70 7 A Dovizioso (Ita) Honda 69 8 C Vermeulen (Aus)Suzuki 64 9 L Capirossi (Ita) Suzuki 61 10 R de Puniet (Ft) Honda 58 11 A de Angelis (RSM) Honda 47 12 T Elias (Spn) Honda 47 13 N Hayden (US) Ducati 46 14 J Toseland (GB) Yamaha 45 15 M Kallio (Fin) Ducati 28 16 N Canepa (Ita) Ducati 20 17 S Gibernau (Spn) Ducati 12 18 Y Takahashi (Jpn) Honda 9 19 G Talmacsi (Hng) Honda 1
125cc race result:
1 J Simon (Spn) Aprilia 39:57.337 2 S Gadea (Spn) Aprilia 40:06.752 3 J Olive (Spn) Derbi 40:14.896
125cc championship standings:
1 J Simon (Spn) Aprilia 129 points 2 S Gadea (Spn) Aprilia 104 3 B Smith (GB) Aprilia 98.5
250cc race result:
1 M Simoncelli (Ita) Gilera 27:11.034 2 A Debon (Spn) Aprilia 27:11.513 3 A Bautista (Spn) Aprilia 27:11.562
250cc championship standings:
1 H Aoyama (Jpn) Honda 134 2 A Bautista (Spn) Aprilia 124 3 H Barbera (Spn) Aprilia 106
Bookmark with:
What are these?