Lewis Hamilton extended his lead in the world championship despite finishing the Singapore Grand Prix third behind winner Fernando Alonso of Renault.
The McLaren driver has a seven-point lead over Ferrari's Felipe Massa with three races remaining.
Massa led early on but finished 13th after a delay when he left the pits with his fuel hose still attached.
Alonso ended a season's frustration when a safety car period tallied perfectly with his team's strategy.
The double world champion had been quick all weekend but qualified only 15th when a fuel pump problem stopped him taking part in the second session.
Renault put him on a short first stint and he climbed up to 11th before an early stop on lap 12.
That meant that when the safety car came out after Alonso's Renault team-mate Nelson Piquet Jr crashed on lap 15, the Spaniard was alone in not having to stop for fuel and tyres.
Massa's race - and possibly his title hopes - were wrecked by an error
Once everyone had stopped, Alonso was fifth behind Williams's Nico Rosberg, Toyota's Jarno Trulli, Force India's Giancarlo Fisichella and BMW Sauber's Robert Kubica.
But Rosberg and Kubica had to serve stop-go penalties for pitting while the pit lane was closed during the safety car period.
Trulli and Fisichella were on single-stop strategies but Alonso had more than enough pace to ensure he made enough of a gap to ensure he could make a second stop and stay ahead of them.
It was his first win since last year's Italian Grand Prix, when he was driving for McLaren, a team he left after one season following a tumultuous season as Hamilton's team-mate.
A second intervention by the safety car closed the field up for the last 10 laps but Alonso was always in control and he finished ahead of Rosberg and Hamilton.
Toyota's Timo Glock was fourth ahead of Toro Rosso's Sebastian Vettel, BMW Sauber's Nick Heidfeld, Red Bull's David Coulthard and Williams's Kazuki Nakajima. 606: DEBATE
I have to say please can Ferrari do that every weekend it was hilarious
Ferrari's Kimi Raikkonen crashed out coming out at the notorious Turn 10 chicane on lap 57 while running fifth.
The first safety car intervention defined the race in more ways than Alonso's victory.
Massa had looked set to dominate, leading away from pole position and pulling away from Hamilton in the early stages of the race.
But when Massa stopped for fuel and tyres under the safety car, he was given a green light to leave the pits from Ferrari's pit equipment before the refuelling hose had been detached.
The Brazilian pulled away, knocked over a mechanic, and tore the refuelling hose away from the equipment.
He had to stop at the end of the pit lane and wait for his mechanics to sprint down and remove it before he could rejoin the race at the back.
Massa's afternoon was then made even worse when he was given a drive-through penalty for leaving his pit dangerously.
Hamilton dropped back behind the Red Bulls of Mark Webber and David Coulthard when most of the field stopped during the safety car period.
But the gearbox on Webber's car failed and Hamilton passed Coulthard just before his final stop on lap 42.
That left the Englishman third behind Alonso and Rosberg when a second safety car period following an accident to Force India's Adrian Sutil on lap 51 closed the field right up.
Alonso's 20-second lead was reduced to nothing, but he got a jump on Rosberg as the race re-started and pulled away again to secure the win.
Hamilton tracked Rosberg to the finish but, with the championship at stake and Massa not scoring, preferred not to take any risks in pursuit of an extra couple of points and secure the six for third place.
Provisional result of Singapore Grand Prix:
1 Fernando Alonso (Spa) Renault one hour 5 minutes
2 Nico Rosberg (Ger) Williams-Toyota 2.9 seconds behind
3 Lewis Hamilton (GB) McLaren-Mercedes +5.9secs
4 Timo Glock (Ger) Toyota +8.1secs
5 Sebastian Vettel (Ger) Toro Rosso-Ferrari +10.2secs
6. Nick Heidfeld (Ger) BMW Sauber +11.101
7. David Coulthard (GB) Red Bull-Renault +16.387
8. Kazuki Nakajima (Jpn) Williams-Toyota +18.489
9. Jenson Button (GB) Honda +19.885
10. Heikki Kovalainen (Fin) McLaren-Mercedes +26.902
11. Robert Kubica (Pol) BMW Sauber +27.975
12. Sebastien Bourdais (Fra) Toro Rosso-Ferrari +29.432
13. Felipe Massa (Brz) Ferrari +35.107
14. Giancarlo Fisichella (Ita) Force India-Ferrari +43.571
R15 Kimi Raikkonen (Fin) Ferrari 57 laps completed
R Jarno Trulli (Ita) Toyota 50 laps completed
R Adrian Sutil (Ger) Force India-Ferrari 49 laps
R Mark Webber (Aus) Red Bull-Renault 29 laps
19 Rubens Barrichello (Brz) Honda 14 laps
20 Nelson Piquet Jr (Brz) Renault 13 laps