World champion Valentino Rossi won a fantastic four-way scrap to take victory in the German MotoGP race.

The Italian held off the challenges of fellow countryman Marco Melandri, American Nicky Hayden and Spaniard Dani Pedrosa to take the win in front of 93,748 spectators at the Sachsenring.

Rossi had started the race in tenth on the Camel Yamaha but cut his way through the field to take the lead on the 13th of 30 laps and was able to keep Melandri's Fortuna Honda and the Repsol Hondas of Hayden and Pedrosa behind him.

Melandri grabbed the lead with three laps to go into turn one but Rossi was back in front later in the same lap and held his advantage to the chequered flag for his fourth race win of the season.

Rossi admitted he was surprised to win after struggling with the set-up on his Yamaha M1 during practice and qualifying.

"This result is quite unbelievable for me and for my team," he said.

"During the practice I was always behind and struggling with the bike.

"A very big thank you to my team, we changed a lot of things (on the bike) this morning and this afternoon.

"We did a great job with Michelin, they helped us a lot."

"Escape (from his pursuers) was impossible and I had another great battle with Marco on the last lap."

Hayden leads the championship standings with 169 points, ahead of Rossi on 143, Pedrosa on 140 and Melandri on 134.

Briton James Ellison finished 13th to lie 17th in the standings on the Tech 3 Yamaha on 17 points.

Yuki Takahashi won the 250cc race with a last-lap pass on Alex de Angelis after closing down the long-time race leader.

Master Aspar Aprilia's De Angelis had broken away to leave a four-man group involving Takahashi to battle over second place.

But the Japanese rider closed in on his San Marino rival and snatched the lead going into the final corner before crossing the line just ahead of De Angelis.

Humangest Honda rider Takahashi has moved up to third in the series, with Spaniard Jorge Lorenzo in the lead after finishing the race third on the Fortuna Aprilia.

Italian Andrea Dovizioso, Takahashi's team-mate, is second in the series standings after finishing the race in fourth.

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.

Pasini took the race win for Master Aspar Aprilia as he out-dragged team-mate Bautista, the championship leader, to the line, with Pesek taking third for Derbi.

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.