Marc Marquez took victory in MotoGP's inaugural Thailand Grand Prix, passing chief rival Andrea Dovizioso on the final lap to take a step closer to the 2018 championship crown.
In a reversal of their memorable Austrian GP duel from last year, Dovizioso attempted to pass Marquez at the final corner on the last lap, after the Honda rider muscled his way by on Turn 5 at Buriram.
But the Ducati rider could not get the traction on exit, with Marquez cutting back to the inside to reach the chequered flag 0.115s clear of Dovizioso and register his seventh win of the 2018 campaign.
It gives him a championship lead of 77 points with only 100 left to play for in the final four rounds.
Marquez led the opening four laps from pole, but Yamaha's Valentino Rossi tracked him and managed to slipstream his way past the defending champion on the run down to Turn 3 on lap five of 26.
The Italian seemed comfortable enough in the lead with the top riders all moderating their pace in the opening half of the race in the blisteringly hot conditions, but got a poor drive out of the first corner on Lap 11 and dropped to third.
Dovizioso hung on to the lead from there as he and Marquez began to up the pace, although it wasn't until the last five laps that the latter really started to go on to the attack.
On lap 23, Marquez tried to pass Dovizioso at Turn 3, only to run wide, and the following lap the duo swapped places twice, allowing the Yamahas of Maverick Vinales and Rossi, who dropped behind his teammate on lap 20, to close in.
It was the same story on the penultimate lap, with Dovizioso retaining the advantage heading into the decisive final lap.
But after repelling Marquez at Turn 3 with a defensive line, he left an opening heading into Turn 5, and his last-corner attempt at seizing back the advantage failed to pay off.
Vinales was not close enough to capitalise on the two leaders running wide, but still secured his first podium finish since July's German Grand Prix in third, ahead of Rossi, who picked up his best result since Brno in August.
Johann Zarco underlined Yamaha's improved form with a strong run to fifth on the satellite Tech 3 machine, passing the Suzuki of Alex Rins and the fading LCR Honda of Cal Crutchlow to take the place.
The Frenchman was also helped by Dani Pedrosa crashing out of fifth on lap 19 at Turn 5.
Completing the top 10 were a trio of satellite Ducati riders, with Nieto's Alvaro Bautista leading Pramac pair Danilo Petrucci and Jack Miller.
Hafizh Syahrin (Tech 3) was the top rookie in 12th, a place behind the second Suzuki of Andrea Iannone, while the remaining points went to Aleix Espargaro (Aprilia), Franco Morbidelli (Marc VDS Honda) and Bradley Smith (KTM).
The only crasher besides Pedrosa of a relatively incident-free race was the second LCR bike of Takaaki Nakagami, who remounted to finish two laps down in 22nd.