By Andrew Benson
BBC Sport in Sao Paulo
Highlights - Brazilian Grand Prix
Red Bull's Mark Webber won the Brazilian Grand Prix to take his first victory of the season in the final race after Sebastian Vettel hit trouble.
Vettel led from the start but ran into gearbox problems. He let Webber past and concentrated on ensuring he got to the finish in second place.
McLaren's Jenson Button and Ferrari's Fernando Alonso battled for third, with Button getting past with 10 laps left.
Button's team-mate Lewis Hamilton retired with a gearbox failure.
Button's third place sealed second spot in the championship, while Webber moved ahead of Alonso into third by just one point.
Webber's victory will be a relief for the Australian, who had faced the prospect of finishing without a win in a season which Vettel has dominated throughout, taking 11 wins and a record 15 pole positions from 19 grands prix.
"Very good," Webber said. "Felt good all weekend, Sebastian did a great lap for pole, had a little bit of the rub of the green.
We had an amazing season and it would be over the top to be upset now
Red Bull driver Sebastian Vettel
"It would have been nice to have a race with Seb all the way through. He's had a bit of a gearbox problem, that's bad luck, but that's how motorsport goes sometimes.
"Very important win for the team and me to end the year on a high."
Vettel appeared comfortable in the lead until his engineer Guillaume Rocquelin issued the first of several warnings to his driver that he had a "serious gearbox problem" and that he needed to "short-shift" to ensure he finished the race.
Webber closed in and Vettel eventually waved him past at the start of lap 30.
Despite the problem, and at least three further warnings from Rocquelin, Vettel continued to lap close to Webber's pace, appearing to not be quite ready to accept he had to lose out to Webber.
But when the two men set fastest laps as the race approached quarter-distance, Rocquelin warned him again: "Sebastian, we have a serious gearbox problem, you need to do everything you can to save the car. The objective is to stay ahead of Alonso."
At that point, Vettel did finally ease off and start asking about the gap back to Alonso.
Brazilian Grand Prix - top three drivers
Vettel went on the radio to say he felt like Ayrton Senna in 1991, when the Brazilian legend took one of his greatest wins here, battling a damaged gearbox, and stuck in sixth gear for the final laps.
"The difference is he won," Vettel said. "I had a good start and was able to pull a gap, but very early I got the call to manage the problem.
"It was getting worse through the race and I ended up using higher gears everywhere, that's where the comparison came into my head.
"I tried to do my best. I tried to keep the gap to Fernando for most of the race and then to Jenson close to the end. We had an amazing season and it would be over the top to be upset now."
Alonso soon had to forget any hopes of catching the Red Bull and focus on trying to fend off Button.
The Spaniard qualified in his typical fifth place, but he passed Hamilton around the outside of the second corner on the first lap and set about trying to take third place from Button.
Hamilton pleased to end 'interesting' 2011 season
After tracking the McLaren closely for 10 laps, he passed Button around the outside of the 135mph Turn Five on lap 11.
BBC F1 co-commentator David Coulthard said: "That was an incredible pass - you would never dream of going around the outside there. That is the mark of a great driver."
Button said he had backed out of his defence because of debris on the track.
"It is normally an easy place to defend," he said. "I took the inside line but as I got there I saw there was quite a lot of debris, perhaps from Michael's (Schumacher) damaged tyre and I didn't want to drive through it, so I had to back off. That was disappointing"
Alonso appeared secure in third place, but Ferrari's season-long problems with the harder Pirelli tyres returned to haunt them, and after their final stops Alonso found himself short of grip and helpless in holding off Button.
The Englishman passed him into Turn Four on lap 62, after forcing Alonso to compromise his approach to the back straight by making him go defensive into Turn One.
McLaren asked Button to have a go at trying to take second from Vettel, telling him that the German was nursing his gearbox, but the Red Bull had more than enough pace to stay ahead.
Button and Hamilton had been closely matched throughout the race until Hamilton became stuck behind Ferrari's Felipe Massa after his second pit stop.
Before he could try to get past the Brazilian, Hamilton was warned he had a gearbox problem, and the unit failed on lap 46.
"I'm just happy the season's done," Hamilton said. "It's been an interesting year. I gave it my all today. It's unfortunate we were unable to get the extra points."
Massa took fifth place, with Force India's Adrian Sutil, Mercedes driver Nico Rosberg, Force India's Paul di Resta, Sauber's Kamui Kobayashi and Renault's Vitaly Petrov taking the remaining points positions.