Marquez made it to second on track on the same lap, after which he set about pursuing Dovi.
Rookie Hafizh Syahrin Abdullah is relieved to have passed his first MotoGP "exam" in flying colours at the season opening Qatar Motorcycle Grand Prix. The fight was neck and neck on the final lap; Baldassarri made his move into the secondlast corner and briefly took the lead, only for Bagnaia to grab it straight back and holding the advantage to the line.
Losail Circuit Sports Club Vice-President and GM Khalid al-Remaihi applauds Valentino Rossi, while at right, victor Andrea Dovizioso (C) second-placed Marc Marquez (L) and Rossi celebrate on the podium.
"This season is the most balanced MotoGP season ever", said Rossi, with a two-year contract extension freshly signed ahead of Sunday's floodlit opener at Qatar's Losail circuit.
Italian Danilo Petrucci was third on the grid, 0.005 slower than Marquez, as the best of the Ducati riders on a non-works Pramac team bike.
Last season, Dovizioso, Pedrosa and Rossi again finished in the top five.
Third position and the final spot on the podium was a sensational battle, as five riders became nine, swopping paint on each lap.
Girlfriend jailed for deadly YouTube prank
The two ran a YouTube channel devoted to videos about their lives as young parents, as well as typical YouTube prank fare. The last moments of the video show Perez pointing the gun at her boyfriend's chest and firing a single round.
Marquez then threw his Honda up the inside of the Ducati into the final corner, but ran wide and allowed Dovizioso to cut back past and hold on to the flag.
He added: "It s a very good way to start the season".
In the Moto2 class, Khairul Idham Pawi of Idemitsu Honda Team Asia settled for 25th place with a time of 2:02.433s during qualifying, while Malaysia's Moto2 rookie, Zulfahmi Khairuddin of SIC Racing Team, finished last with his best lap time of 2:04.780s. "But I want to do better than just finish", he said.
And so, all that was left for number 93 was to console himself with a second place finish: "I always give it my all, pushing 100% - the rider from Cervera said - This is a hard track for me, but I was able to get close to the win anyway". There is still a lot more that I need to learn in MotoGP.
"I expect more compared to last year, because with this year's bike I feel good", said Rossi, who also finished third in Qatar in 2017.
There was heartbreak for Suzuki as Alex Rins, who was in for a podium finish in the first half of the race but crashed out at turn two on lap 13.