Niccolo Antonelli opened the new Moto3 season with his third career victory in Qatar, outdragging Brad Binder to win a thrilling photo finish by a scant 0.007s.
Ajo KTM rider Binder looked to have done enough to hang on for his maiden Grand Prix win when he arrived at the start of the final lap with his lead intact, the South African heading a tightly bunched group of seven bikes.
But exiting the final corner, Binder had Antonelli, who had vaulted to second at Turn 1 on the final tour, for company - and the Ongetta Honda rider was able to get the tow to pip his rival to the finish line.
"On the last lap, I knew if I stayed behind Brad I had a chance," said Antonelli. "I'm very happy because it wasn't an easy weekend, I was sick, but today I was better and I could push very hard."
Runner-up Binder commented: "I knew it was gonna be close, either just win it or take second. The last two laps I pushed really hard, and I noticed nobody passed me [before the finish line] so I thought I could hang on."
Just behind the lead duo, Francesco Bagnaia stole an unlikely podium for the Aspar Mahindra team, battling his way through on the final lap to take the Indian marque's best Moto3 result since 2014.
Sky Racing's Romano Fenati had been one of the race's main protagonists, the Italian starting from pole and spending much of the race swapping the lead with Binder.
But the KTM rider blew any chance of victory when he ran wide at the first corner on the final lap, eventually recovering to fourth ahead of Enea Bastianini (Gresini Honda) - a late joiner to the lead group - and Fenati's teammate Niccolo Bulega.
Rookie star Bulega enjoyed a brief spell in the lead with three laps to go, but was ultimately shuffled back to sixth place ahead of Livio Loi (RW Honda), who squandered his front row start when he ran wide at the start of the second lap.
Phillip Oettl (Schedl KTM) and Jakub Kornfeil (SIC Honda) completed the top 10, with Leopard Racing's Fabio Quartararo getting bogged down in the second group of riders early on and ultimately finishing a disappointing 13th after starting third on the grid.
|1||Niccolo Antonelli||Honda NSF250RW||38:12.161|
|2||Brad Binder||KTM RC 250 GP||+0.007|
|3||Francesco Bagnaia||Mahindra MGP30||+0.148|
|4||Romano Fenati||KTM RC 250 GP||+0.435|
|5||Enea Bastianini||Honda NSF250RW||+0.606|
|6||Nicolo Bulega||KTM RC 250 GP||+0.625|
|7||Jorge Navarro||Honda NSF250RW||+0.674|
|8||Livio Loi||Honda NSF250RW||+1.710|
|9||Philipp Oettl||KTM RC 250 GP||+8.611|
|10||Jakub Kornfeil||Honda NSF250RW||+10.947|
|11||Jules Danilo||Honda NSF250RW||+12.379|
|12||Joan Mir||KTM RC 250 GP||+12.380|
|13||Fabio Quartararo||KTM RC 250 GP||+12.401|
|14||Bo Bendsneyder||KTM RC 250 GP||+12.726|
|15||Aron Canet||Honda NSF250RW||+12.784|
|16||Maria Herrera||KTM RC 250 GP||+12.939|
|17||Andrea Migno||KTM RC 250 GP||+17.152|
|18||Hiroki Ono||Honda NSF250RW||+17.367|
|19||Gabriel Rodrigo||KTM RC 250 GP||+17.451|
|20||Adam Norrodin||Honda NSF250RW||+17.519|
|21||Andrea Locatelli||KTM RC 250 GP||+17.566|
|22||Khairul Idham Pawi||Honda NSF250RW||+17.608|
|23||Darryn Binder||Mahindra MGP30||+31.939|
|24||Alexis Masbou||Peugeot MGP30||+31.949|
|25||Juanfran Guevara||KTM RC 250 GP||+32.120|
|26||Fabio Di Giannantonio||Honda NSF250RW||+32.333|
|27||John McPhee||Peugeot MGP30||+32.547|
|28||Tatsuki Suzuki||Mahindra MGP30||+32.812|
|29||Stefano Valtulini||Mahindra MGP30||+34.584|
|30||Karel Hanika||Mahindra MGP30||+59.105|
|31||Lorenzo Petrarca||Mahindra MGP30||+59.109|
|32||Fabio Spiranelli||Mahindra MGP30||+1:34.948|
|R||Jorge Martin||Mahindra MGP30