Reigning world champion Valentino Rossi held off Marco Melandri, Nicky Hayden and pole-sitter Dani Pedrosa to win the German MotoGP at the Sachsenring.
Rossi holds off the challenge of his rivals to clinch a thrilling win
Rossi battled from 10th on the grid to claim his fourth MotoGP win of the season in 41 minutes 59.248 seconds.
The Italian took the lead on lap 13, lost it briefly with three laps to go, before clinching victory on his Yamaha.
Melandri was second and Hayden third, with Pedrosa fourth. Britain's James Ellison came home in 13th place.
Rossi said he was surprised to win after struggling with the set-up on his Yamaha M1 during practice and qualifying, but said a good start had been crucial.
"This result is quite unbelievable for me and for my team," he said. "During practice, I was always behind and struggling with the bike.
"I was able to get off to a great start and immediately got among the leaders. It was a real battle, especially with Marco at the end."
Rossi donned an Italian football shirt emblazoned with the name of Marco Materazzi on his victory lap.
Valentino managed to win the battle at the end. I tried my hardest but he was very, very quick and closed all the doors
Materazzi, who plays for Rossi's team Inter Milan, was on the wrong end of a Zinedine Zidane headbutt in the World Cup final.
"It was an incredible race," Melandri said. "Unfortunately Valentino managed to win the battle at the end. I tried my hardest but he was very, very quick and closed all the doors."
Hayden leads the championship standings with 169 points, ahead of Rossi on 143, Pedrosa on 140 and Melandri on 134.
Ellison is 17th in the standings after amassing 17 points on his Tech 3 Yamaha.
Rookie Casey Stoner had been forced to pull out of Sunday's race after crashing his Honda in the warm-up.
The 20-year-old Australian was taken to hospital with suspected concussion and bruising to his hands.
Despite being given the all-clear following a scan, Stoner - sixth in the standings in his first season in the top class - opted not to race.
Japans' Yuki Takahashi won the 250cc race with a last-lap pass on Alex de Angelis after closing down the long-time race leader.
Britain's Dan Linfoot finished outside the points in 19th on the Teng Tools Winona Racing Honda.
Victory in the 125cc race went to Italy's Mattia Pasini, who won a three-way battle with Spanish team-mate Alvaro Bautista and the Czech Republic's Lukas Pesek.
Britain's Bradley Smith was 12th on the Repsol Honda, making it two scoring rides in a row after picking up his first points in the previous round at Donington Park.
German MotoGP result, Sachsenring:
1. Valentino Rossi (ITA) Yamaha 110.130km in 41mins 59.248secs
2. Marco Melandri (ITA) Honda 0.145 behind
3. Nicky Hayden (USA) Honda 0.266
4. Dani Pedrosa (ESP) Honda 0.307
5. Loris Capirossi (ITA) Ducati 8.764
6. Shinya Nakano (JPN) Kawasaki 9.147
7. Chris Vermeulen (AUS) Suzuki 16.608
8. Sete Gibernau (ESP) Ducati 16.648
9. Carlos Checa (ESP) Yamaha 17.097M
10. John Hopkins (USA) Suzuki 27.425
13 J Ellison (GB) Tech 3 Yamaha (Britain) 43:01.277
After 10 rounds
1. Nicky Hayden (USA) Honda 169 points
2. Valentino Rossi (ITA) Yamaha 143
3. Dani Pedrosa (ESP) Honda 140
4. Marco Melandri (ITA) Honda 134
5. Loris Capirossi (ITA) Ducati 118
6. Casey Stoner (AUS) Honda 91
7. Colin Edwards (USA) Yamaha 77
8. Shinya Nakano (JPN) Kawasaki 67
9. Kenny Roberts Jr (USA) KR211V 66
10. John Hopkins (USA) Suzuki 64
1. Yuki Takahashi (Japan) Honda 41:30.350
2. Alex de Angelis (San Marino) Aprilia 41:30.408
3. Jorge Lorenzo (Spain) Aprilia 41:31.363
19. Dan Linfoot (Britain) Honda 41:34.920
1. Jorge Lorenzo (Spain) Aprilia 174
2. Andrea Dovizioso (Italy) Honda 172
3. Yuki Takahashi (Japan) Honda 133
1. Mattia Pasini (Italy) Aprilia 39:44.091
2. Alvaro Bautista (Spain) Aprilia 39:44.101
3. Lukas Pesek (Czech Republic) Derbi 39:44.202
12. Bradley Smith (Britain) Honda 40:10.480