Fabio Di Giannantonio won a dramatic Moto3 Thailand Grand Prix, while Jorge Martin extended his points lead to 29 after main rival Marco Bezzecchi was taken out at the final corner.
Bezzecchi was a factor in the victory battle for the entirety of the 22-lap contest before Enea Bastianini took him down on the last lap, while Martin slowly made his way through the pack while nursing a muscle injury in his left hand.
Poleman Bezzecchi took the holeshot at the start, with fellow front row dwellers Jaume Masia and Kazuki Masaki slotting in behind.
Masaki [RBA] moved up to second at Turn 3, though Darryn Binder soon muscled his Red Bull Ajo KTM into the position at the end of the second tour.
Binder got forceful again at Turn 12 next time around, which forced Fabio Di Giannantonio and Tony Arbolino wide and back to the lower reaches of the top 10, before Binder was wiped out by an aggressive Albert Arenas moments later at Turn 8.
Martin struggled to make much impression on the points in the early stages, while title rival Bezzecchi was demoted by Leopard's Lorenzo Dalla Porta, though the Prustel rider retaliated soon after.
A frantic battle at the front saw the lead change hands a number of times, with Bezzecchi, Dalla Porta taking turns at the head of the pack along with Dennis Foggia and Ayumu Sasaki.
The latter would crash just seconds after hitting the front at Turn 5 on lap 14, while fellow Japanese rider and early podium contender Masaki fell off after a slight nudge from Martin a few corners ahead.
Bezzecchi regained the lead from Dalla Porta at Turn 3 on the penultimate lap after an ambitious lunge from Di Giannantonio pushed Foggia wide and opened the door.
The Prustel GP rider held onto the lead as the field start the last lap, but had his pocket picked at Turn 4 by Dalla Porta and Di Giannantonio, with the latter pair swapping position at Turn 8.
Di Giannantonio maintained the lead across the final sector to snatch his second win of the season, while drama unfolded behind when Bastianini crashed while in third, taking Bezzecchi with him.
Dalla Porta held onto second, while Foggia – who started from 25th – completed the podium for the first time in his career, while Martin gritted his teeth to take fourth.
Bezzecchi's crash has given Martin a 26-point lead in the championship, while Gresini teammate Di Giannantonio moves into contention a further three points adrift.
Gabriel Rodrigo rounded out the top five ahead of a season-best sixth for Vicente Perez. Nicolo Bulega, Marcos Ramirez, wildcard Somkiat Chantra and Jakub Kornfeil completed the top 10, while the final points were taken by Andrea Migno, Kaito Toba, Philipp Oettl, Tony Arbolino and Adam Norrodin.
Britain's John McPhee was in the hunt in that lead group in the closing stages, but the CIP rider crashed at the last corner on the penultimate lap.