Andrea Dovizioso won the Malaysian Grand Prix on Sunday to keep the MotoGP title race alive into the final stop of the season as championship leader Marc Marquez was held to a fourth place finish.

Ducati rider Dovizioso overtook his runner-up team mate Jorge Lorenzo with four laps left and held firm for his sixth win of the season in soggy conditions at Sepang International Circuit.

Frenchman Johann Zarco grabbed third on the podium on his non-works Yamaha.

Honda's Marquez moved to 282 points in the championship and will take a 21-point lead over Dovizioso to the final race in Valencia in two weeks, with 25 points left up for grabs.

Reigning champion Marquez should wrap up the title in Spain if his bike stays on two wheels.

Stranger things have happened, however, and 31-year-old Dovizioso was not ruling out his chances of a maiden title.

"Everything can happen during the weekend, and you never know about the weather," he told reporters on Sunday.

"We know it's difficult but we are relaxed. We are going to Valencia in a relaxed way and will try to do the maximum."

Dovizioso started third on the grid behind pole-sitter Dani Pedrosa yet it was Marquez charging into the lead with a brilliant start from seventh.

He was forced to turn wide, however, and fell quickly back to third behind Zarco and Lorenzo.

Dovizioso had the roughest start but roared past Marquez on the fourth lap and kept the Spaniard at bay thereafter.