MOTEGI - Ducati's Andrea Dovizioso stunned world champion Marc Marquez on the final lap to win a rain-soaked Japanese Grand Prix and blow the MotoGP title race wide open on Sunday.

The Italian pipped Marquez's Honda by 0.25 seconds in a classic dogfight at Motegi to record his fifth victory of the season, cutting the Spaniard's championship lead to 11 points with three races left. Dovizioso made a blistering start from ninth on the grid as he joined Marquez in chasing down early leader Danilo Petrucci. The title rivals sped past Petrucci's Ducati midway through the race before going wheel-to-wheel in a nail-biting game of cat and mouse as rain made track conditions treacherous.

Twice Dovizioso roared past Marquez -- and twice Marquez produced daring lunges to recapture the lead, the triple world champion entering the penultimate lap in front. But just when it looked as though Marquez would hang on for his third successive victory, the Spaniard suffered a last-lap wobble, allowing Dovizioso to pounce for the race-winning pass at turn 11.

As Dovizioso flashed by to snatch a breathtaking win, it triggered wild celebrations in the Ducati garage. "I knew I had a last chance at the back straight, turn 11, but he was pushing and the tyres were finished," said Dovizioso. "I did a perfect corner at turn 10 and he made a mistake so I was able to catch him."

Marquez still kept coming but Dovizioso kept his cool to take the chequered flag, suggesting he could take the title race down to the wire. "I knew that in the last two corners anything could happen," said the Italian. "Marc was behind me but I closed the door and made it very difficult for him to overtake me. Fighting Marc is always big tension," he added. "But this was important for the championship. I know it will be very difficult to win the title but we will try right to the end."

Marquez, chasing a fourth world title in five years, paid tribute to the winner. "It was amazing today, I enjoyed the battle," said the Spaniard. "The two guys that are fighting for the championship fighting until the last corner." "I made a few mistakes -- Motegi is one of the circuits where I have struggled a lot for some years," added Marquez, already looking ahead to next week's race in Australia. "I knew the Ducati was faster on the back straight, even in the braking point. At this circuit I knew he would be very, very strong. But now we go to other tracks that I normally enjoy more."

Petrucci finished third, ahead of Suzuki's Andrea Iannone and Alex Rins with former champion Jorge Lorenzo's Ducati sixth and Aleix Espargaro seventh on his Aprilia. French rookie Johann Zarco finished back in eighth for Yamaha after a dismal start from pole, while Maverick Vinales now trails Marquez by a daunting 41 points after finishing ninth and realistically looks out of it. Seven-time champion Valentino Rossi, who is continuing his return from a double leg fracture, dumped his Yamaha in the gravel on lap six, ending his race.