Bastianini wins Malaysian MotoGP as Bagnaia extends title lead
The Italian Bastianini cruised home at Sepang more than 1.5 seconds ahead of Alex Marquez in second, with Bagnaia third and Martin a distant fourth.
The factory Ducati rider Bagnaia is favourite to retain his crown but the championship looks set to go right down to the final race of the season in Valencia at the end of the month.
"I tried to close the gap to Alex and Bastia but I was struggling a lot on the braking," said the 26-year-old Bagnaia.
"But I'm happy we managed to open a bit of a gap in the championship."
He said that an advantage of 14 points was "not too much" but still "better than nothing".
"If it was a normal season with one race it's a good gap to manage, but 37 points each weekend (including sprint races) means there's (only) a small gap," he cautioned.
Bagnaia made a sluggish start from pole and was swallowed up right away by Martin, who had begun second on the grid, and Bagnaia's factory Ducati team-mate Bastianini.
But Pramac's Martin immediately ran wide and the Italian Bastianini, who started third on the grid, emerged at the front.
Bastianini led Malaysian MotoGP sprint winner Marquez through a third of the 20 laps, with Martin and Bagnaia squabbling over third.
In fierce heat, the race settled into a groove from there as Bastianini pulled out into a lead of nearly a second on Gresini Racing's Marquez, with Bagnaia third and Martin struggling for pace in fourth.
It was to remain that way to the end.
Bastianini has suffered an injury-hampered campaign but the Italian nicknamed "The Beast" held his nerve at the front to cruise home for an ultimately comfortable victory, his first of the season.
"I'm tired and I have given 100 percent today," said the 25-year-old.
"After a long time without a podium, today is a victory.
"Only me, my friends, my girlfriend and family knows what I needed to do to arrive here."
Marco Bezzecchi came into Sepang in third place in the championship and still mathematically in contention for the world title.
But his unlikely hopes of winning the title evaporated as he rode home in sixth.
A thrilling campaign goes to Qatar next weekend before the season-ending race in Valencia on November 26.
Earlier, MotoGP-bound Pedro Acosta was crowned the Moto2 world champion after the Spaniard finished the race in Sepang second behind compatriot Fermin Aldeguer.