Lewis Hamilton beat Mercedes Formula 1 team-mate Nico Rosberg to win a breathless Bahrain Grand Prix by just one second.
A late-race safety car, deployed after Pastor Maldonado's Lotus tipped Esteban Gutierrez's Sauber into a roll at Turn 1, turned the 57-lap race into a 10-lap sprint under floodlights in the desert.
Both drivers had gone wheel-to-wheel in the early stages, as Hamilton outdragged poleman Rosberg at the start and the German attempted to come back at his British team-mate, so they were warned to keep it clean by Mercedes boss Paddy Lowe.
They just about managed it as they scrapped mightily for the win.
Rosberg had the advantage of softer tyres for the showdown and had several stabs at passing Hamilton using DRS into the Michael Schumacher corner.
But he could not make either stick, and Hamilton prevailed on his medium tyres after some epic side-by-side racing through the esses.
Behind, Force India recorded its first podium since Spa 2009 as Sergio Perez just held off the quicker Red Bull of Daniel Ricciardo.
The Red Bulls also had the advantage of soft tyres for the final sprint and Ricciardo got the better of his world champion team-mate Sebastian Vettel and Nico Hulkenberg's Force India to finish fourth.
Vettel, who complained of a lack of power from his Renault engine, could not find his own way past Hulkenberg (on ageing mediums) so had to spend the final two laps fending off Williams pair Felipe Massa and Valtteri Bottas for sixth.
Williams gambled on a three-stop strategy where most of the other frontrunners went for two, and the safety car undid its hopes of a better result.
The Ferraris of Fernando Alonso and Kimi Raikkonen rounded out the top 10, after Jenson Button joined McLaren team-mate Kevin Magnussen in retirement, after plummeting down the top order following the re-start.
Bahrain GP - 57 laps Pos Driver Team Time/Gap 1. Lewis Hamilton Mercedes 1h38m42.743 2. Nico Rosberg Mercedes +1.085s 3. Sergio Perez Force India-Mercedes +24.067s 4. Daniel Ricciardo Red Bull-Renault +24.489s 5. Nico Hulkenberg Force India-Mercedes +28.654s 6. Sebastian Vettel Red Bull-Renault +29.879s 7. Felipe Massa Williams-Mercedes +31.200s 8. Valtteri Bottas Williams-Mercedes +31.800s 09. Fernando Alonso Ferrari +32.500s 10. Kimi Raikkonen Ferrari +33.400s 11. Daniil Kvyat Toro Rosso-Renault +41.300s 12. Romain Grosjean Lotus-Renault +43.100s 13. Max Chilton Marussia-Ferrari +59.900s 14. Pastor Maldonado Lotus-Renault +1m02.800s 15. Kamui Kobayashi Caterham-Renault +1m27.900s 16. Jules Bianchi Marussia-Ferrari +1 lap 17. Jenson Button McLaren-Mercedes +2 laps Retirements Kevin Magnussen McLaren-Mercedes 40 laps Esteban Gutierrez Sauber-Ferrari 39 laps Marcus Ericsson Caterham-Renault 33 laps Jean-Eric Vergne Toro Rosso-Renault 18 laps Adrian Sutil Sauber-Ferrari 17 laps Drivers' standings: 1. Nico Rosberg 61 2. Lewis Hamilton 50 3. Nico Hulkenberg 28 4. Fernando Alonso 26 5. Jenson Button 23 6. Sebastian Vettel 23 7. Kevin Magnussen 20 8. Valtteri Bottas 18 9. Sergio Perez 16 10. Daniel Ricciardo 12 11. Felipe Massa 12 12. Kimi Raikkonen 7 13. Jean-Eric Vergne 4 14. Daniil Kvyat 3 Constructors' standings 1. Mercedes 111 2. Force India-Mercedes 44 3. McLaren-Mercedes 43 4. Red Bull-Renault 35 5. Ferrari 33 6. Williams-Mercedes 30 7. Toro Rosso-Renault 7