Jorge Martin prevailed in an almighty three-way scrap to beat Marc Marquez and Pecco Bagnaia to victory in MotoGP's French Grand Prix.
A tense, cat-and-mouse fight between points leader Martin and defending double champion Bagnaia came alive in the closing stages at Le Mans as Marquez - from 13th on the grid - joined their battle for victory.
Bagnaia got the best start away from the line to jump polesitter Martin on the run through the first corner and up to the Dunlop chicane, and from their the leading duo established a small but definite edge over the chasing pack - headed at various times by Aleix Espargaro, Fabio Di Giannantonio and Maverick Vinales.
Although Bagnaia briefly pulled half a second on Martin, he never advanced further ahead than that and Martin had caught up to the rear of the factory Ducati rider heading into the final third of the 27-lap race.
Martin made a first play for the lead on lap 20 but got in too hot into the chicane, allowing Bagnaia to bide his time and sweep back underneath Martin to reclaim the lead down the hill on the run to La Chapelle.
But while Martin made the same move stick a lap later, he and Bagnaia were by this point being caught rapidly by Marquez, now just a second behind.
Marquez made up five places alone on the opening lap from 13th following his Q1 exit a day earlier, overtook Enea Bastianini when the Ducati ran wide on lap two, and gained another place a lap later when Pedro Acosta made the first major error of his rookie MotoGP season - his ambitious attempt to take advantage of an Espargaro/Di Giannantonio squabble ending with him sliding off, somehow finding a gap between the two.
Moves on Aprilia pair Espargaro and Vinales midway through the race brought Marquez up to fourth and once he'd cleared Di Giannantonio on lap 17 at the second attempt - as the VR46 Ducati rider overshot at the chicane attempting to reclaim the spot - it seemed only a matter of time before he joined the lead battle.
He did exactly that, with MotoGP's current heavyweight trio covered by half a second for a good deal of the final five laps of the race.
Martin ran slightly deep into the chicane with three laps to go and that gave Bagnaia a sniff of sticking his front wheel up the inside down the hill, but Pramac Ducati rider Martin quickly snuffed out that move - in the process forcing Bagnaia to focus on keeping Marquez at bay.
Just 0.277s covered the three over the line at the start of the final lap but while Martin was again slightly wide at the chicane he held firm at the front.
His victory was ultimately secured as Marquez pulled off an ambitious lunge for second on Bagnaia into the Esses, giving Martin the break he needed to claim his second win of the season and extend his points lead.
Runner-up spot matched Marquez's best finish as a Gresini Ducati rider from the Jerez round a fortnight earlier and secure him a double podium - having also advanced from 13th to finish second in the sprint race a day earlier.
Third for Bagnaia means he is now Martin's closest challenger in the standings, albeit 38 points behind the satellite Pramac rider.
He was backed up in fourth by team-mate Bastianini - though he faced a case of what might have been.
Bastianini had been forced to fight his way back through the order following a long lap penalty for skipping the Esses while he battled Espargaro for sixth that dropped the factory Ducati to ninth.
Having worked his way back through to fourth, Bastianini was the quickest rider on track in the closing stages but ran out of laps to catch the leading trio, finishing 1.6s behind Bagnaia.
Vinales couldn't live with Marquez's pace as he reeled in the leaders and ultimately ceded position to Bastianini in the final laps but was still the first non-Ducati home over the line in fifth, with Di Giannantonio sixth after a long lap penalty of his own for overshooting the chicane.
He spent the final laps battling with Vinales' team-mate Espargaro, though the second Aprilia dropped to ninth on the final lap behind Franco Morbidelli (Pramac Ducati) and Brad Binder.
Eighth marked an impressive recovery from the back of the grid for Binder following a catastrophic qualifying session on Saturday. He was the lead KTM rider home and one of only two to see the finish, as his works team-mate Jack Miller joined Acosta in crashing out.
Alex Marquez completed the top 10 on the second Gresini Ducati, with Raul Fernandez 11th and the LCR Hondas of Johann Zarco and Taka Nakagami sandwiching 13th-placed Augusto Fernandez (Gas Gas).
Fabio Quartararo was running sixth and on course of his and Yamaha's best result of the season when he crashed out of his home race.
His team-mate Alex Rins, who served an early long lap penalty, beat the works Honda of Luca Marini to the final point.