(Reuters) -Italian Francesco Bagnaia held off a strong challenge from Enea Bastianini to win the San Marino Grand Prix in front of his home fans in Misano Adriatico on Sunday.
Ducati's Bagnaia finished 0.034 seconds ahead of Gresini Racing rider Bastianini, who is joining Ducati next year, to celebrate a thrilling victory after starting fifth on the grid.
He became the first Ducati rider to win four consecutive MotoGP races, having also triumphed in the Austrian, British and Dutch grands prix.
Bagnaia moved to second in the world championship standings, closing the gap on leader Fabio Quartararo of Yamaha to 30 points. Aleix Espargaro of Aprilia slipped to third after finishing sixth on Sunday.
Maverick Vinales of Aprilia Racing completed the podium and Quartararo finished fifth after starting eighth on the grid following a disappointing qualifying session.
Pole sitter Jack Miller crashed out of the lead on the opening lap and ended the race in 18th on his Ducati. Mooney VR46 Racing Team's Marco Bezzecchi also crashed and finished 17th after starting third.
Italian Andrea Dovizioso came 12th for the Yamaha RNF team in his final race in the premier class.
(Reporting by Manasi Pathak in Bengaluru, editing by Ed Osmond)