|Andrea Dovizioso celebrates winning the Qatar MotoGP. (AFP/KARIM JAAFAR) |
The two riders swapped positions on the final lap but it was Dovizioso, having led for much of the race on his Ducati, who secured victory by just 0.023 of a second over his Honda rival, and ensure a repeat of last year's top two in Doha.
Britain's Cal Crutchlow, on another Honda, also made the podium, finishing third.
"I don't know, it was a strange race," said a jubilant Dovizioso afterwards. "Overall, I am so happy."
The Italian had come into the Doha race concerned about the speed of his bike, but had been able to start in second place on the grid, following qualification.
He led a group of eight riders who dominated the race but was closely followed by Marquez all the way.
The Spaniard, who started third on the grid, pounced on the tenth corner of the final lap to take the lead, albeit briefly, before Dovizioso immediately took back the advantage.
"It was exactly the same as last year, I tried to be there at the end," said Marquez.
Spain's Alex Rins finished fourth on a Suzuki, with legendary Italian Valentino Rossi, on a Yamaha, in fifth.
Maverick Vinales, also on a Yamaha and who started in pole position, finished seventh.
French rookie Fabio Quartararo, another Yamaha rider, finished in 16th place despite starting in fifth on the grid after being forced to start the race from the pit lane after his bike stalled in the warm-up lap.
Despite safety fears over the desert track's condition during the night race, only one rider crashed out, Britain's Bradley Smith.
Meanwhile, in the night's other races, teenager Kaito Toba snatched victory in Moto3 to become the first Japanese rider to win in that class.
Italy's Lorenzo Dalla Porta was second with Spain's Aron Canet third.
"It's an amazing feeling," said Toba. "This weekend we have worked very, very hard."
There was also an exceptionally close finish in the Moto 2 race with Italian Lorenzo Baldassarri just edging out Switzerland's Thomas Luthi to win.
German Marcel Schrotter, who started on pole, took third place.