An aggressive first-lap Jorge Martin lunge on MotoGP title rival Pecco Bagnaia meant Enea Bastianini found himself in position to dominate the Thai Grand Prix sprint.
The move relegated both Martin and Bagnaia out of the victory battle, but Martin then fought back to power past Bagnaia and extend his championship lead with second place.
Martin had drawn level with Bastianini behind Bagnaia off the line, but then attacked into Turn 1, running himself and Bagnaia wide through the corner.
He said after the race: "I was braking quite hard, I saw that if I don't release the brake I touch somebody - so I preferred to go out and lose positions."
It allowed both Bastianini and Marc Marquez ahead of the title fight duo, while Martin also let rookie Pedro Acosta through as he slotted back into the pack in fifth.
Bagnaia repassed Marquez for second before the opening lap was over, but Bastianini was already up the road by then and only getting further clear - and it was the battle for second that provided the intrigue instead.
Martin dealt with Acosta at Turn 5 on the second lap, which brought him onto the back of Bagnaia and Marquez. He overtook the latter into the final corner on lap four, then lunged down the inside Bagnaia at the fast Turn 7, right after the change of direction, to claim second place.
Martin, however, ran out wide in seeing out the corner, for his first track limits strike of the race.
He then committed another offence at the same spot two laps later, straddling the very edge of the kerb and seemingly just dipping down. But he stayed within limits for the rest of the race, so avoided a long-lap penalty.
Bagnaia kept Martin under pressure over the remaining laps, but eventually had to admit defeat and settle for the final podium position.
Marquez took fourth, followed by his brother and Gresini team-mate Alex, while Franco Morbidelli (Pramac Ducati), Marco Bezzecchi (VR46 Ducati) and Fabio Di Giannantonio (VR46 Ducati) finished behind.
It meant Ducati locked out the top eight in full, with the only other remaining points position going to KTM's Brad Binder.
Thai GP points positions
- Enea Bastianini
- Jorge Martin
- Pecco Bagnaia
- Marc Marquez
- Alex Marquez
- Franco Morbidelli
- Marco Bezzecchi
- Fabio Di Giannantonio
- Brad Binder
Ducati's top-eight lockout was made possible by Acosta crashing out while in Martin's tow on lap four, recording his fourth consecutive race retirement.
Yamaha's Fabio Quartararo had a couple of moments early in the race that meant he couldn't capitalise on his sixth-place starting position, finishing a close 10th behind Binder.
With two sprints and three grands prix left, Martin leads Bagnaia by 22 points.