AP

VALENCIA, Spain -- Reigning two-time champion Marc Marquez won his 13th MotoGP race of the season at the season-ending Valencia Grand Prix on Sunday, breaking Australian Mick Doohan's record of 12 wins set in 1997.

Former seven-time MotoGP champion Valentino Rossi finished second as rain began to make the track slippery to finish as the championship runner-up. Dani Pedrosa was third after Jorge Lorenzo abandoned the race when trying to change his motorcycle for the spare machine fitted with rain tires.

Lorenzo finishes the season in third place.

Rossi had started the race on pole, followed by fellow Italian Andrea Iannone with Dani Pedrosa third and Lorenzo fourth.

Although Marquez started fifth, he soon rose to fourth, before overtaking Pedrosa, Rossi and Iannone.

In the process, Marquez beat Pedrosa's lap record of one minute, 31.55 seconds set last year at the 4-kilometer (2.4-mile) eastern Cheste circuit despite a rain-dampened track.

"I am very, very happy," said Marquez. "During the race I sometimes thought of my brother, but said to myself that I'd better do this well, especially when it was raining and I wasn't sure what to do. It was really hard to maintain my concentration."

Younger brother Alex Marquez won his first Moto3 world championship after finishing third in his category race.

Maverick Vinales won the Moto2 category, with Mika Kallio of Finland second and Esteve Rabat of Spain third. Rabat is Moto2 champion ahead of Kallio and third-placed Vinales.

Jack Miller won the Moto3 race but could not overcome an 11-point gap to Marquez. Miller finished second in the overall title race.

Marquez started third on the grid behind Australia's Miller after Italian Niccolo Antonelli had taken pole position.

Miller made a clean start to lead by the first bend while Marquez dropped to fourth before recovering to clinch the title.

Isaac Vinales finished second in the race while Alex Rins finished third in the championship.