Ferrari driver Sebastian Vettel held off a tremendous late charge from Mercedes rival Lewis Hamilton to win the Bahrain Grand Prix on Sunday and take the overall lead in the Formula One title race.
Hamilton was catching the German on every lap but ultimately ran out of time and finished almost seven seconds behind.
''The car was really amazing to drive,'' Vettel said. ''Lewis was a threat towards the end and with the traffic you never know.''
Vettel and Hamilton were level with a win each, but Vettel's second victory of the season and 44th of his career puts him in command heading into the Russian GP in Sochi in two weeks' time.
''We just have to make sure we keep it going. But for now the team has done a really, really great job,'' Vettel said. ''I had a good feeling yesterday and after a couple of laps (today) I thought everything was making sense.''
Mercedes driver Valtteri Bottas finished third after starting from pole position for the first time. It was his 11th podium.
''I didn't have enough pace today and we have to find the reasons why,'' the Finnish driver said. ''It was a really tricky race today. I was oversteering all through the race.''
Ferrari's Kimi Raikkonen was fourth.
Bottas made a clean start but Hamilton was beaten for pace by Vettel, who overtook him heading into the first corner.
''Sebastian was in my blind spot so I didn't know where he was,'' Hamilton said.
Hamilton's hopes were also hit when the British driver was given a five-second time penalty early into the race for driving too slowly in the pit lane and holding up Red Bull's Daniel Ricciardo, who was fifth.
''The pit lane was really my fault so apologies to my team for losing time there,'' Hamilton said. ''I tried my hardest to catch up. We will push hard together, keep fighting. Losing points for the team is definitely painful.''
There is strong mutual respect between three-time F1 champion Hamilton and four-time champion Vettel, and the British driver gave him a warm handshake after the race.
Vettel completed the 57 laps of the 5.4-kilometer (3.4-mile) track in 1 hour, 33 minutes, 53 seconds, for his third win in Bahrain after success with Red Bull in 2012 and 2013.
It was 24 degrees Celsius (75 Fahrenheit) with a refreshing breeze when the race started at 6 p.m. local time (1500 GMT) and finished under floodlights.
Bottas got away cleanly but crucially Hamilton was beaten for pace by Vettel, while Max Verstappen went from sixth to fourth after passing Raikkonen and Ricciardo.
With Bottas losing power in his rear tires, Vettel sensed it was the right time to pit for new tires on lap 11.
Verstappen asked his team to match that strategy and he came in on the next lap.
But moments later, the Dutchman's brakes failed and he drifted across the track and into the wall, his race over. The 19-year-old Verstappen, who had driven so well from 16th place on the grid to finish third in China last weekend, climbed out and kicked the barriers in frustration.
The incidents were coming fast, with 18-year-old Lance Stroll hit from the side on lap 13 by Carlos Sainz Jr. and this forced the safety car to come out.
Both Mercedes drivers used the safety car incident to pit for new tires, but Hamilton made the mistake of holding up Ricciardo.
''It made it twice as hard as it was going to be,'' Hamilton said.
When the race began in earnest again on lap 17, Hamilton burst straight past Ricciardo into third while Vettel brilliantly defended the corner twice to fend off Bottas.
By the halfway point, Vettel's lead was six seconds over Hamilton, who had just passed Bottas.
There was some frantic action behind the leaders, with Fernando Alonso battling it out in midfield. He was not happy with his McLaren car's performance, though, saying ''I've never raced with less power in my life'' over the radio.
With Hamilton gaining fast, Vettel came in for his second tire change on lap 34 and came out fourth behind Raikkonen.
Hamilton was the new race leader, but with more than 20 laps to go, a time penalty still to take, and with Vettel on new tires, it was a precarious lead.
Hamilton came in with 15 laps left - and took his time penalty. This put Bottas in second place, but he then backed off to let the quicker Hamilton through to chase Vettel down.
''Thanks to Valtteri for being a gentleman,'' said Hamilton, who endured a much more difficult relationship with Nico Rosberg, his former Mercedes teammate.
Meanwhile, Alonso retired one lap from the end. His teammate Stoffel Vandoorne did not even start because of engine failure.
(For more sports news and updates, follow Ahram Online Sports on Twitter at @AO_Sports and on Facebook at AhramOnlineSports.)