Andrea Dovizioso passed Marc Marquez on the final lap to win a thrilling Japanese MotoGP and reduce the championship deficit to his title rival.

Italian Dovizioso, who started from ninth on the grid, headed into the closing moments of the rain-soaked race at Motegi in second place.

But the Ducati rider made his move on Honda's Marquez with just four corners remaining to clinch a brilliant victory.

Marquez, the three-time world champion, nearly re-passed Dovizioso at the final turn, but the Italian pulled away on the straight to cross the line with a winning margin of just 0.249 seconds.

Dovizioso's fifth victory of the campaign moves him to just 11 points behind Marquez with three rounds remaining.

Seven-time champion Valentino Rossi, who is continuing his recovery from a double leg fracture, spun out in the opening phase of the race.