Dani Pedrosa ended the MotoGP season with a win in Valencia after newly-crowned world champion Jorge Lorenzo spectacularly crashed out.
who won the title last month,
opted to start on slick tyres on a wet track and took the lead as other riders changed from wet tyres.
However, he was catapulted off while attempting to lap a backmarker.
Final MotoGP standings
Jorge Lorenzo - 350 points
Dani Pedrosa - 332 points
Casey Stoner - 254 points
Andrea Dovizioso - 218 points
Alvaro Bautista - 178 points
That allowed Pedrosa to win, with Katsuyuki Nakasuga second and Casey Stoner, in his last MotoGP race, third.
Lorenzo, who was not injured in his spill despite landing on his head and sliding into the gravel trap, picked up his world title at an awards ceremony later on Sunday.
Stoner, who won the championship in 2007 and 2011, produced a late spurt to finish on the podium in his final race after
retiring from the sport at the age of just 27.
The Australian told BBC Sport: "I took the easy way out by starting on wet tyres and to be honest, I was scared of crashing.
"I didn't want to injure my foot any more than I have already, especially in my last race. You can see there were a lot of crashes today.
Amazing overtakes set up Marquez win
"My eyes were the size of dinner plates the whole race. With a couple of laps to go I decided to go for it and it's a fantastic way to end it. I want to thank all my supporters down the years."
With riders starting on different tyres, the first few laps were chaotic as Aleix Espargaro took a shock lead to become the first CRT rider to lead a MotoGP race.
Within a few laps it was clear that the slick tyres were quicker, and as riders came into the pits to change bikes Lorenzo was able to stay out and take the lead.
Lorenzo and Pedrosa, who lined up on wets before changing his mind on the warm-up lap and coming in to change tyres and start the race from the pit lane, pulled clear before Lorenzo's huge crash.
The Spaniard was trying to lap British rider James Ellison when he got off line, weaved several times before being catapulted into the air and landed on his head before coming to a stop.
Lorenzo on title-winning season
That left Pedrosa clear to win his seventh race of the season, while British rider Cal Crutchlow, who had been set for a best-ever finish of second, crashed out late on to give Nakasuga a place on the podium.
In the day's earlier races,
Danny Kent took victory in the Moto3 class
before Marc Marquez produced a remarkable ride to win the
World champion Marquez started from 33rd and last on the grid but managed to scythe through to 11th by the end of the first lap.
The 19-year-old -
who will replace Stoner in MotoGP next year
- eventually worked his way through to win the 26th grand prix of his young career.
Valencia MotoGP results:
1. Dani Pedrosa (Spa) Repsol Honda 48:23.819
2. Katsuyuki Nakasuga (Jpn) Yamaha 49:01.480
3. Casey Stoner (Aus) Repsol Honda 49:24.452
4. Alvaro Bautista (Spa) 49:26.630
5. Michele Pirro (Ita) Gresini FTR 49:50.427
6. Andrea Dovizioso (Ita) Tech 3 Yamaha 49:54.242
7. Karel Abraham (Cze) Cardion Ducati 49:55.608
8. Danilo Petrucci (Ita) Ioda Suter +1 lap
9. James Ellison (GB) PBM ART +1 lap
10. Valentino Rossi (Ita) Ducati +1 lap