Lewis Hamilton became Formula One's youngest ever world champion by finishing fifth in an incredibly dramatic rain-affected Brazilian Grand Prix.
Felipe Massa won the race for Ferrari and looked set to take the title until McLaren driver Hamilton slipped past Timo Glock's Toyota and into the crucial fifth place at the final corner of the very last lap.
Fernando Alonso (Renault) and Kimi Raikkonen (Ferrari) completed the podium finishers, ahead of Toro Rosso's Sebastian Vettel, whose penultimate lap pass on Hamilton had looked set to hand Massa the title, only for Glock's gamble of staying on dry tyres in a late race shower to fail, causing the Toyota to slip from fourth to sixth within sight of the flag and giving Hamilton the title after all.
Ferrari still clinched the constructors' title, as the two McLarens only finished fifth and seventh.
The start was delayed by ten minutes after a brief, but heavy, downpour hit Interlagos just before the mechanics were due to clear the grid.
Although the sunshine returned within a few minutes, the first half of the track was left very wet, so the whole field took the start on intermediates.
The top four got away in good order, but there was chaos further back when Nico Rosberg tapped David Coulthard into a spin, with the Red Bull swiping Rosberg's Williams teammate Kazuki Nakajima, bringing Coulthard's final F1 race to a sadly early end. Renault's Nelson Piquet also exited his home race in a separate first lap incident.
The safety car then came out for three laps while Coulthard's car was retrieved, after which Massa edged away at the front as Raikkonen put pressure on front row starter Jarno Trulli (Toyota) for second and Hamilton ran a safe fourth.
His teammate Heikki Kovalainen lost out to both Vettel and Alonso as he tried to protect Hamilton on the first lap, and although he dived back past Alonso at the restart, the McLaren ran wide and lost the place again.
The track rapidly dried out, and by lap 11 everyone was back on slick tyres.
But Hamilton was, along with Raikkonen and Trulli, the last to pit - and his caution proved costly, as he rejoined back in seventh place.
Early stoppers and wet weather specialists Vettel and Alonso had vaulted up to second and third, and would impressively push Massa until their next stops, while Force India's Giancarlo Fisichella had been the first to gamble on dry tyres and emerged in fifth - between Raikkonen and Trulli, who swapped places in the pits.
Hamilton soon passed Trulli when the Italian made an error at the Senna S, but it was not only lap 17 that he was able to overtake Fisichella at the same place and move back into the crucial fifth position.
He then gained another place when Vettel made an early second stop on lap 27 and fell from second to sixth. Although the Toro Rosso briefly reappeared second when others made their final stops, Vettel's own third pit visit dropped him back to fifth behind Hamilton again by the end.
Massa managed to pull out a comfortable gap over Alonso prior to his second stop, with Raikkonen steadily closing on the Renault and Hamilton driving cautiously in fourth.
But then the rain returned with just seven laps remaining, prompting everyone to pit bar the Toyotas, with Glock rising to fourth, ahead of Hamilton and Vettel.
Hamilton still looked set to cling on and take the title, until he ran wide at the final corner when Robert Kubica dived through to unlap himself with just three laps to go. That let Vettel through as well, and suddenly it appeared that the title had slipped away from Hamilton again.
But within sight of the flag his luck changed once more, with Glock losing 17 seconds on the last lap as the rain increased, allowing the McLaren to sweep through and back into fifth place. The Ferrari team had already started celebrating a potential Massa title, but the mood abruptly changed as it became clear that Hamilton had snatched the crown after all.
Classified:
1. Massa Ferrari (B) 1h34:11:435
2. Alonso Renault (B) + 13.298
3. Raikkonen Ferrari (B) + 16.235
4. Vettel Toro Rosso-Ferrari (B) + 38.011
5. Hamilton McLaren-Mercedes (B) + 38.907
6. Glock Toyota (B) + 44.368
7. Kovalainen McLaren-Mercedes (B) + 55.074
8. Trulli Toyota (B) + 1:08.433
9. Webber Red Bull-Renault (B) + 1:19.666
10. Heidfeld BMW Sauber (B) + 1 lap
11. Kubica BMW Sauber (B) + 1 lap
12. Rosberg Williams-Toyota (B) + 1 lap
13. Button Honda (B) + 1 lap
14. Bourdais Toro Rosso-Ferrari (B) + 1 lap
15. Barrichello Honda (B) + 1 lap
16. Sutil Force India-Ferrari (B) + 2 laps
17. Nakajima Williams-Toyota (B) + 2 laps
18. Fisichella Force India-Ferrari (B) + 2 laps
Fastest lap: Massa, 1:13.376
Not classified/retirements:
Piquet Renault (B)
Coulthard Red Bull-Renault (B)