Red Bull KTM Ajo rider Jack Miller enjoyed a fierce battle with Estrella Galicia's Alex Marquez in Qatar, emerging on top to claim his maiden Moto3 victory.
The pair broke away in the opening laps at the desert-based track and swapped places for much of the race until the chasing pack reeled them in during the closing stages.
However, 19-year-old Miller took advantage when Marquez ran wide on a dramatic final lap and pulled a slight gap to take his first podium on the top spot.
The Australian's victory denied Honda the Moto3 win they have been searching for all weekend as the manufacturer's wait for a first class win since 2012 continues.
Miller also became the first non-Spanish rider to win a Grand Prix in any class since Scott Redding won the Moto2 round at Silverstone last year.
Marquez had been right in contention until the final lap before a mistake dropped him to fourth, although he managed to recover to claim second place on the line, 0.233 seconds behind Miller.
The experience of Erfen Vazquez served him well as an expertly timed slipstream move enabled him to steal third place for Racing Team Germany from Miguel Olivera by a tyre's width.
Olivera finished as the top Mahindra performer behind the Honda/KTM battle, while Alex Rins – quickest in practice – finished fifth, recovering from a poor start to force his way back into contention.
Pole man Rins had been as low as 12th on the opening lap before staging a determined fight back.
Team Calvo's Jakub Kornfeil was next in sixth just ahead of Frenchman Alexis Masbou for Ongetta-Rivacold, with Kornfeil's team-mate Issac Vinales securing eighth.
The battle of the Italians was won by Go&Fun rider Niccolo Antonelli in ninth beating fellow countryman Francesco Bagnaia of Sky Racing Team VR46 into tenth position.
John McPhee was the leading British rider in 11th for Racing Team Germany, with Danny Kent completing the race in 14th for Red Bull Husqvarna.
The remaining points went to Team Sky rider Romano Fenati in 12th and top rookie Karel Hanika in 14th for Red Bull KTM Ajo, while Brad Binder earned the final point for Ambrogio Racing.
SIC-AJO's Hafiq Azmi and Team Calvo's Eric Granado collided on the first lap and Team Italia's Matteo Ferrari was also ruled out on the opening lap following a spill.
Other non-finishers included Niklas Ajo and Juanfran Guevara, while Mahindra's Arthur Sissis did not make the grid after suffering tonsillitis.