Marc Marquez moved top of the world championship standings with victory at the German Grand Prix as Britain's Cal Crutchlow finished second.
Repsol Honda's Marquez had started on pole, but lost places to first Valentino Rossi and then Stefan Bradl.
However, by lap six Marquez had clawed his way to the front, where he remained for the rest of the race.
Crutchlow pushed hard in the final few laps but, despite his best efforts, could not find enough to catch Marquez.
Rossi, bidding for his second successive win of the season, finished third.
"We had a very good race. The victory is so important because those 25 points mean a lot in the championship," Marquez told BBC Sport.
The win boosted Marquez's title hopes, especially as neither reigning world champion Jorge Lorenzo nor Dani Pedrosa were competing in the race at Sachsenring.
Pedrosa, who arrived in Germany as the championship leader, also injured himself in practice this weekend, fracturing his collarbone and was unable to race.
That meant a win for Marquez would move him top of the standings by two points.
However, the young Spaniard's start was far from ideal. Rossi got the better of him on the first turn, while Stefan Bradl and Aleix Espargaro also passed him.
But it did not take long for Marquez to start his charge back to the front, passing Espargaro on lap two before forcing his way past Rossi and then Bradl and into the lead.
Crutchlow, who had qualified second, also dropped places early in the race, finding himself sixth by lap two.
But, like Marquez, he made his way back up through the field with relative ease and by lap 10 he was up to third.
Crutchlow made a couple of unsuccessful attempts to pass Rossi before finally getting the better of the Italian on lap 16, sneaking down the inside into Turn 11 and into second.
The Tech 3 Yamaha rider then set about chipping away at Marquez's two-second lead, and though he managed to bring it down to 1.5 seconds in the closing stages, Marquez had done enough for his second win of the season.
"Well done to Marc because he raced a great race," said Crutchlow. "Even if Dani Pedrosa or Jorge Lorenzo were here I believe this would have been the same result, I really do.
"We have made a massive step. I had my worst ever result here in 2011 and I gave my all this time and, considering my physical condition, I am really happy."
Suter rider Jordi Torres claimed his maiden race win when the Spaniard beat Simone Corsi and Pol Espargaro to victory in the German Moto2 Grand Prix.
Kalex's British rider Scott Redding finished seventh, but remains top of the standings.
Finally, Spain's Alex Rins snatched victory ahead of KTM team-mate Luis Salom in the Moto3 race.
Salom was aiming to add this to his wins in Italy, Catalunya and Assen and looked set to do just that when he passed Rins with four laps remaining.
However, Rins reclaimed the lead in the final lap to take victory.
German MotoGP results:
1 Marc Marquez (Spa) Repsol Honda 41mins 14.653secs
2 Cal Crutchlow (Gbr) Tech 3 Yamaha 41:16.212
3 Valentino Rossi (Ita) Yamaha 41:24.273
4 Stefan Bradl (Ger) LCR Honda 41:28.645
5 Alvaro Bautista (Spa) Gresini Honda 41:36.428
6 Bradley Smith (Gbr) Tech 3 Yamaha 41:39.733
7 Andrea Dovizioso (Ita) Ducati 41:44.680
8 Aleix Espargaro (Spa) Aspar ART 41:44.977
9 Nicky Hayden (USA) Ducati 42:00.008
10 Michele Pirro (Ita) Pramac Ducati 42:01.795