Jorge Lorenzo extended his lead at the top of the MotoGP standings after edging out Dani Pedrosa to win the Catalunya Grand Prix in Barcelona.
Lorenzo managed to fight past his fellow Spaniard with six laps to go to take his third win of the season.
Andrea Dovizioso was third, with Casey Stoner fourth and British rider Cal Crutchlow fifth.
Lorenzo now leads reigning world champion Stoner by 20 points in the standings.
Lorenzo told BBC Sport: "It was a very tough race.
"It was very hot and complicated. At the beginning it was very easy to touch Dani and end up on the ground, so I had to wait and be careful.
"Then Dani made one mistake which was enough for me to get through."
Pedrosa was only fifth on the grid but made a trademark start to lead into turn one as Stoner was bumped down to fifth from pole position.
Ben Spies was briefly into the lead on lap three but the American crashed out to leave Yamaha team-mate Lorenzo behind Pedrosa in second.
Spies rejoined and fought his way back through to finish 10th.
Lorenzo and Pedrosa swapped the lead twice before 2010 champion Lorenzo made the decisive move with six laps to go after Pedrosa wheelied.
Crutchlow was all over the back of Stoner in the closing laps but could not find a way past as Stoner finished a race off the podium for the first time in 20 races - a run stretching back to last April.
Crutchlow said: "It's only my second time here and I shouldn't have let the leaders go at the start.
"Then I ran wide and let Casey past and I just couldn't get past him. My team-mate [Dovizioso] was on the podium which shows what we can do but it will come around soon.
"It's Silverstone next and this sets us up for my home race."
In the earlier support races, Maverick Vinales comfortably won the Moto3 race ahead of Sandro Cortese, who now holds a seven-point lead over Vinales at the top of the standings, with Miguel Oliveira third.
Andrea Iannone held off Thomas Luthi to win the Moto2 race, with Marc Marquez crossing the line third after clashing with title rival Pol Espargaro - who crashed out.
Marquez was handed a 60-second penalty by the stewards, which relegated him to 23rd spot and promoted Espargaro's teammate Esteve Rabat into third, but he later won an appeal and was reinstated.
Catalunya MotoGP results:
1. Jorge Lorenzo (Spn) Yamaha 43:07.681
2. Dani Pedrosa (Spn) Repsol Honda 43:12.684
3. Andrea Dovizioso (Ita) Tech 3 Yamaha 43:17.042
4. Casey Stoner (Aus) Repsol Honda 43:17.225
5. Cal Crutchlow (GB) Tech 3 Yamaha 43:20.187
6. Alvaro Bautista (Spn) Gresini Honda 43:21.629
7. Valentino Rossi (Ita) Ducati 43:25.236
8. Stefan Bradl (Ger) LCR Honda 43:31.159
9. Nicky Hayden (USA) Ducati 43:38.091
10. Ben Spies (USA) Yamaha 43:40.578