Marc Marquez became MotoGP world champion in his rookie season as he took third place in an epic Valencia decider won by Jorge Lorenzo.
With a 13-point advantage, 20-year-old Marquez only needed fourth place to become the first rookie champion since Kenny Roberts in 1978 and the youngest ever premier class title-winner.
Lorenzo needed a win and to hope disaster befell Marquez, and he did his utmost by blasting his Yamaha into the lead at the start, as Marquez fell to third behind Honda team-mate Dani Pedrosa.
It appeared in the first half of the race that Lorenzo's tactic was to slow the pace and bunch the pack to give rivals ample chance to attack Marquez.
Instead all the action was around Lorenzo, as he and Pedrosa engaged in a spectacular tussle.
Six times in the first seven laps Pedrosa overtook the double champion, only for Lorenzo to force a way back through each time, as well as hanging on under braking through countless other close calls.
The crunch came approaching one-third distance, when Pedrosa took the lead at Turn 1 and Lorenzo's retaliation into Turn 2 ended in contact that sent both wide.
As Marquez swept into the lead, Pedrosa fell to fifth behind the swiftly-recovering Lorenzo, Alvaro Bautista and Valentino Rossi.
Race direction will investigate this clash after the race.
Lorenzo was soon back in the lead, as Marquez made it easy for him as soon as his very determined championship rival appeared on his tail.
The Honda man did repass Lorenzo briefly further around the lap, before deciding to play it safe.
Lorenzo then abandoned his previous strategy and made a break for it, leaving Marquez to his own devices and setting a blistering, lap-record-smashing pace.
The Spaniard went on to take his eighth win of 2013 - two more than Marquez - by 3.9 seconds.
Pedrosa recovered to second, with Marquez settling for a third place that made him champion after a remarkable debut season.
Rossi and Bautista fell away in fourth and fifth.
Cal Crutchlow was an early crasher in his final race for Tech 3 Yamaha, leaving Stefan Bradl and Bradley Smith to finish sixth and seventh.
Nicky Hayden led the Ducati ranks in his farewell appearance for the team in eighth. Pramac rider Andrea Iannone had given his factory counterparts a very hard time but fell late on.
Aleix Espargaro came out on top in CRT again in his Aspar swanswong, as qualifying sensation Danilo Petrucci dropped back.
Results - 30 laps: Pos Rider Team/Bike Time/Gap 1. Jorge Lorenzo Yamaha 46m10.302s 2. Dani Pedrosa Honda +3.934s 3. Marc Marquez Honda +7.357s 4. Valentino Rossi Yamaha +10.579s 5. Alvaro Bautista Gresini Honda +14.965s 6. Stefan Bradl LCR Honda +24.399s 7. Bradley Smith Tech 3 Yamaha +29.043s 8. Nicky Hayden Ducati +39.893s 9. Andrea Dovizioso Ducati +53.196s 10. Michele Pirro Ducati +1m02.983s 11. Aleix Espargaro Aspar Aprilia +1m04.197s 12. Hector Barbera Avintia FTR-Kawasaki +1m06.826s 13. Claudio Corti Forward FTR-Kawasaki +1m11.481s 14. Danilo Petrucci Ioda-Suter-BMW +1m13.643s 15. Colin Edwards Forward FTR-Kawasaki +1m24.249s 16. Hiroshi Aoyama Avintia FTR-Kawasaki +1m33.010s 17. Michael Laverty PBM Aprilia +1 lap 18. Luca Scassa Cardion Aprilia +1 lap 19. Bryan Staring Gresini FTR-Honda +1 lap 20. Martin Bauer Remus Suter-BMW +1 lap Retirements: Andrea Iannone Pramac Ducati 26 laps Randy de Puniet Aspar Aprilia 23 laps Cal Crutchlow Tech 3 Yamaha 9 laps Yonny Hernandez Pramac Ducati 8 laps Lukas Pesek Ioda-Suter-BMW 3 laps Damian Cudlin PBM-Aprilia 3 laps