Honda's Dani Pedrosa kept his MotoGP title fight alive with a win in hazardous conditions in Malaysia.
Jorge Lorenzo almost crashed out in the wet before the race was eventually stopped on lap 14 of 20. The Yamaha ace now leads the standings by 23 points.
There was a confusing 20-minute delay before the decision was made to abandon the race and award full points.
Defending champion Casey Stoner took third, with Britain's Cal Crutchlow one of a host of riders crashing in Sepang.
Pedrosa said: "This victory is really amazing for me. It's the first time I've won in the wet in my life and I'm really, really happy.
"The rain came down heavy and it was hard to stay on the bike. I was lucky to be able to win this race and also Jorge was lucky to finish second because he was almost on the ground."
Earlier, Sandro Cortese won to secure the Moto3 title while Briton Gino Rea took third in a Moto2 race also heavily affected by rain.
The MotoGP race was delayed by 15 minutes due to the heavy rain throughout the day, and Lorenzo and fellow Spaniard Pedrosa soon opened up a four-second lead over the chasing pack.
Lorenzo's Yamaha team-mate Ben Spies continued his shocking season by crashing out on lap nine and Andrea Dovizioso also then crashed out of fourth position at turn seven. He was able to rejoin.
Pedrosa edged ahead of Lorenzo at the end of lap 10 before Crutchlow and then Stefan Bradl both crashed out in quick succession as the conditions deteriorated. Crutchlow has now failed to finish in four of his last six races.
Lorenzo signalled for the race to be stopped, before he almost crashed out with six laps to go. The race was then red flagged.
In the Moto3 race, Cortese needed to finish in the top three to take the title after his main rival Maverick Vinales surprisingly quit his Blusens team on Friday, calling them a "second division" outfit.
The race started in 35C heat but spots of rain began to fall over some of the circuit with nine laps to go.
Malaysian rider Zulfahmi Khairuddin led for most of the race but Cortese was able to pass him on the final lap to win and seal the inaugural Moto3 crown in style.
Cortese, 22, said: "I can't believe it. It is a dream come true."
The rain then arrived in force, with a downpour delaying the start of the Moto2 race by half an hour.
Championship leader Marc Marquez was shifted down the standings early on as British rider Rea briefly led.
Marquez then crashed out with seven laps remaining as the rain returned and the race was red flagged as the conditions detoriated.
Alex De Angelis was awarded the win, with Anthony West in second and Rea in third.
Malaysian MotoGP results (Standings after 13 laps):
1. Dani Pedrosa (Spa) Repsol Honda 29:29.049
2. Jorge Lorenzo (Spa) Yamaha 29:32.823
3. Casey Stoner (Aus) Repsol Honda 29:36.193
4. Nicky Hayden (USA) Ducati 29:39.567
5. Valentino Rossi (Ita) 29:45.808
6. Alvaro Bautista (Spa) Gresini Honda 29:46.325
7. Hector Barbera (Spa) Pramac Ducati 30:19.331
8. Aleix Espargaro (Spa) Aspar ART 30:20.634
9. James Ellison (GB) PBR ART 30:25.725
10. Karel Abraham (Cze) Cardion Ducati 30:26.671