Marc Marquez escaped final-lap contact with Honda team-mate Dani Pedrosa to maintain his unbeaten 2014 MotoGP run in the Catalunya Grand Prix at Barcelona.
Although the result was Marquez's seventh win from seven races this season, he only achieved it after resisting huge pressure from not only Pedrosa, but the Yamahas of Valentino Rossi and Jorge Lorenzo.
It was Lorenzo who muscled his way into the lead on the opening lap, going around the outside of fast-starting polesitter Pedrosa at Turn 1.
Marquez was back in fifth at that point, although he rapidly dismissed Stefan Bradl and rejoined the lead fight.
Despite fearing that he lacked race pace this weekend, Rossi overtook Lorenzo on the fourth lap and then stayed ahead for much of the race, despite Marquez quickly working through to second and then swarming all over the back of the Yamaha.
Marquez came close to hitting Rossi at one stage when he braked too late at Turn 1 and had to shoot over the run-off area to avoid a collision.
That temporarily dropped Marquez behind Pedrosa in third, and gave Rossi some very brief respite before the four-bike lead pack came alive again in the closing stages.
Marquez finally made it into the lead with seven laps to go, then saw a yellow flag and backed off, causing a confusing few moments with the two Hondas and Rossi as all three tried not to overtake each other illegally.
Next time around Marquez completed the pass with less drama, but still could not shake Rossi off, with the Yamaha twice managing to get back in front over the following laps only to run wide each time.
It was Pedrosa who ultimately came closest to denying Marquez, though.
He got between Marquez and Rossi four laps from the finish and then did his utmost to beat his team-mate.
On the final lap Pedrosa dived past Marquez under braking into both Turn 1 and Turn 4, but both times Marquez was able to sneak in front again on the exit.
Then as Pedrosa tried to line up one last move, he clipped the back of his team-mate at Turn 11 and slewed wide, leaving Marquez clear to secure another win and handing second back to Rossi.
Pedrosa still made it home third, with Lorenzo having gradually drifted out of the lead fight in fourth place.
Bradl made it a five-bike lead group for a spell early on before settling for a lonely fifth place on the LCR Honda.
Espargaro brothers Aleix and Pol were sixth and seventh, with the younger sibling having a huge race-long battle with top Ducati rider Andrea Dovizioso, as Andrea Iannone shadowed them both.
Bradley Smith completed the top 10 but fellow Briton Cal Crutchlow pulled into the pits to retire his Ducati early on.
NEWS UPDATE: Redding gets post-race penalty
Results - 25 laps
Pos Rider Bike Time/Gap
1. Marc Marquez Honda 42m56.914s
2. Valentino Rossi Yamaha +0.512s
3. Dani Pedrosa Honda +1.834s
4. Jorge Lorenzo Yamaha +4.540s
5. Stefan Bradl LCR Honda +11.148s
6. Aleix Espargaro Forward Yamaha +14.213s
7. Pol Espargaro Tech 3 Yamaha +16.127s
8. Andrea Dovizioso Ducati +16.175s
9. Andrea Iannone Pramac Ducati +18.040s
10. Bradley Smith Tech 3 Yamaha +24.781s
11. Yonny Hernandez Pramac Ducati +37.153s
12. Scott Redding Gresini Honda +42.921s
13. Nicky Hayden Aspar Honda +43.299s
14. Michele Pirro Ducati +55.157s
15. Hiroshi Aoyama Aspar Honda +59.191
16. Broc Parkes PBM Aprilia +1m00.906s
17. Michael Laverty PBM Aprilia +1m01.284s
18. Colin Edwards Forward Yamaha +1m06.121s
19. Hector Barbera Avintia FTR-Kawasaki +1m25.195s
20. Michel Fabrizio Ioda Aprilia +1m40.665s
Mike di Meglio Avintia FTR-Kawasaki 8 laps
Cal Crutchlow Ducati 15 laps
Alvaro Bautista Gresini Honda 22 laps
Karel Abraham Cardion Honda 24 laps