McLaren's 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 23-year-old Englishman'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 to have cost Hamilton the title when he dropped to sixth after a stop for wet tyres.
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 wet tyres as the rain fell in the closing laps.
But while the Brazilian held on to his lead, Hamilton dropped to fifth place behind Glock - who stayed on dry tyres.
Hamilton then lost that position - which was the minimum he needed if Massa won - when he was passed at the start of the penultimate lap by Vettel.
Hamilton tried hard to get back past the German, but he 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.
"It's pretty impossible to put into words," Hamilton said.
"I thought do I have it? Do I have it? And when they told me I was ecstastic."
It was heartbreaking for Massa, whose family were celebrating what they thought was his success for a few seconds until they realised what had happened.
"It was an emotional day for me. You get here and you've almost done everything perfect but we saw Lewis passing Glock again and that mixed emotion.
"Unfortunately we missed [out] by one point but that's racing.
"We need to be proud of our race and our championship. It's one more day of our life when I will learn a lot but for sure I'm very emotional."
His only consolation was that his victory helped secure the constructors' title for Ferrari.
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 the Toro Rosso had made its stop and he had to up his pace to hold his rival 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.
Scot David Coulthard's final race ended at the first corner after he was knocked into a spin by Williams's Nico Rosberg, and was hit by the other Williams of Kazuki Nakajima.