Lewis Hamilton became the youngest world champion in Formula One history by the skin of his teeth after a nail-biting Brazilian Grand Prix.
The English McLaren driver's title rival Felipe Massa won the race in his Ferrari but Hamilton grabbed the fifth place he needed at the last corner.
A late-race rain shower looked set to rob Hamilton of the title after a stop for wet tyres dropped him to sixth.
But he passed Toyota's Timo Glock as they entered the pit straight.
Renault's Fernando Alonso, the previous youngest champion, was second ahead of Massa's team-mate Kimi Raikkonen and Toro Rosso's Sebastian Vettel.
Hamilton's success buries the ghosts of last year, when after a remarkable debut season he let slip a massive lead in the final two races and Raikkonen sneaked in to win the title.
Ultimately, there were no similar mistakes this time around - but as, he entered the final lap, Hamilton was not going to win the title.
He - like Massa - had stopped to change to tyres as the rain fell in the closing laps.
But while the Brazilian held on to his lead, Hamilton dropped to fifth place behind Toyota's Timo Glock - who stayed on dry tyres.
Hamilton then lost fifth place - which was the minimum he needed if the Englishman won - when he was passed at the start of the penultimate lap by Toro Rosso's Sebastian Vettel.
Hamilton tried hard to pass the German, but he could could not get close enough to him and he would have thought he had lost the title until he came to the last two corners of the lap.
There, Glock - who had started the final lap 18 seconds ahead of Hamilton - was struggling badly on the now-slick track and the McLaren slipped passed the Toyota as it accelerated up the hill towards the finish line.
The thrilling climax was a stark contrast to the rest of the race, which Hamilton had approached with the caution he felt was required to avoid mistakes.
The 23-year-old - watched from the sidelines by his girlfriend Nicole Scherzinger, singer with the Pussycat Dolls - went into the race knowing he only had to finish fifth even if Massa won his home event.
That luxury showed in the way in which he and his McLaren team approached the Grand Prix.
A shower of rain five minutes before the scheduled start introduced a random element that was exactly what Hamilton did not need.
It caused a five-minute delay and shaped the entire race.
The heavy shower doused the track in the area of the pits and some of the corners, but other areas remained dry.
And with the sun shining as the race started, it was only a matter of time before drivers started to pit for dry tyres.
Hamilton and McLaren played it safe, leaving it as late as they could before coming in to change tyres.
Hamilton stopped a lap later than Massa on lap 11 - and two laps after Vettel and Alonso.
McLaren's decision was the right one in that it limited their risk, but it was not the best in terms of absolute pace.
Vettel and Alonso's early stops vaulted them up into second and third places behind Massa.
Hamilton, by contrast, was demoted from fourth to sixth behind Massa, Vettel, Alonso, Raikkonen and the Force India of Giancarlo Fisichella, who had changed to dry tyres as early as lap three.
McLaren were confident the required result was always within their grasp.
But that was reckoning without the unfolding drama ahead.
Hamilton did not pass Fisichella until lap 18, out-braking him in a brave move at the first corner on the still-slippery track.
That put Hamilton into the fifth place he needed, and he was promoted to fourth by the three-stop strategy chosen by Toro Rosso for Vettel in contrast to the two stops of the other leading teams.
Hamilton was only a couple of seconds ahead of Vettel by the time Vettel had made his stop and he had to up his pace to hold the German off.
And a late shower increased the anxiety for Hamilton as he sought to close out the championship.
Hamilton stopped for wet tyres on lap 66 - a decision that could have cost him the title.
It dropped him to fifth place behind Glock, with Vettel right behind him.
Vettel pushed Hamilton hard and passed him with two laps to go, leading to the nail-biting finish.