Sebastian Vettel claimed his second win of the 2017 Formula 1 season in the Bahrain Grand Prix, assisted by a five-second time penalty for Mercedes driver Lewis Hamilton.
Vettel crossed the line 6.660s ahead of Hamilton, who had slashed his advantage from 20s after making his second pitstop, with the second Mercedes of Valtteri Bottas taking third.
Bottas held the lead at the start, with Vettel making a better getaway than Hamilton to draw alongside him on the run to the first corner and then sweep around the outside on turn-in to run second.
Vettel then pressured Bottas in the early laps, the Mercedes driver struggling for rear grip thanks to high rear tyre pressures caused by a faulty generator used to help set them on the grid, with Hamilton just behind and keeping the Red Bulls of Max Verstappen and Daniel Ricciardo just behind him.
With Hamilton eventually slipping out of DRS range of Vettel, the Ferrari driver became the first of the frontrunners to stop on lap 10 and committed to a two-stop strategy by taking a second set of super-softs.
Verstappen followed Vettel into the pits a lap later, but suffered a brake problem on his outlap and went off at Turn 4, his race ending in the barrier.
The safety car was deployed on lap 13, when Williams driver Lance Stroll was hit by Carlos Sainz Jr's Toro Rosso.
Sainz had just made his first pitstop, but closed rapidly under braking for Turn 1, hitting Stroll's sidepod as the Williams took the apex.
The contact put both out of the race, and triggered a flurry of pitstops that allowed Vettel to take the lead.
Mercedes had to pit both Bottas and Hamilton under the safety car, with both having slow stops lasting just over six seconds, and Ricciardo able to emerge from the pits between them.
Hamilton, who knew he would have to queue behind Bottas, slowed on the entry to the pitlane and delayed Ricciardo, leading to a stewards' investigation and subsequent five-second penalty.
Vettel led from Bottas at the restart on lap 17, with Hamilton jumping Ricciardo for third on the run to the first corner, followed on the run to Turn 4 by Williams driver Felipe Massa.
Bottas, who opted for super-softs at his previous stop, made his second stop to take softs 13 laps later, emerging seventh behind Sergio Perez's Force India and quickly moving ahead of both the Mexican and Massa to run fifth.
While Vettel gradually extended his lead to over six seconds from Bottas, Hamilton chased his team-mate before taking second place up the inside into Turn 1 on lap 27.
At that point, Vettel had a 6.3s lead, but Hamilton had cut that advantage to just under four seconds when the Ferrari driver pitted for softs at the end of lap 33.
Vettel emerged from the pits in third place, 17 seconds behind Hamilton and three behind Ferrari team-mate Kimi Raikkonen.
Three laps later, Vettel passed a compliant Raikkonen. At that point, he was 15.5s behind Hamilton on the road, but in real terms just 10.5s thanks to Hamilton's penalty.
Vettel had closed to just 9.5s behind Hamilton on the road when the Mercedes driver made his second stop with 16 laps to go, including a five-second hold to serve the penalty, and returned to the track on soft rubber.
Hamilton re-emerged in third, 10.5s behind second-placed Bottas, with Vettel 20s clear, but with fresh softs he had a significant pace advantage of the two cars in front.
It took Hamilton just five laps to catch and pass Bottas, diving up the inside of his team-mate at Turn 13.
At that point, Vettel's advantage was 13 seconds, and although Hamilton was able to lap faster than the Ferrari he never got within five seconds of the leader.
Bottas had a comfortable advantage over Raikkonen, and even though the gap was just two seconds at the flag he was never under serious threat.
Raikkonen started fifth and was shuffled back to seventh behind both Verstappen and Massa at the first and fourth corners respectively, but recovered to fourth.
He passed Massa shortly after the restart following the safety car, finishing 16.8s ahead of Ricciardo.
Massa was best of the rest outside of the big three teams, with Force India driver Sergio Perez finishing seventh despite starting 18th.
After a good first stint, Perez jumped to seventh under the safety car and maintained control of the position to the end on a two-stop strategy.
Haas driver Romain Grosjean claimed his first points finish of 2017 in eighth place, making his second pitstop before Nico Hulkenberg to undercut his way past the Renault driver.
Force India's Esteban Ocon finished 10th for the third race in succession, with an advantage of 24.2s over Sauber returnee Pascal Wehrlein, who held off Daniil Kvyat's Toro Rosso's attacks in the closing laps of the race.
Renault's Jolyon Palmer was the final driver running at the finish in 13th place, with McLaren driver Fernando Alonso, who was part of a close three-way battle with the pair for much of the race, classified 14th despite pulling into the pits with two laps remaining.
Marcus Ericsson retired the other Sauber in the closing stages of the race, while Haas driver Magnussen also joined Sainz, Stroll and Verstappen on the retirements list on lap nine when he pulled off with a mechanical failure.
Stoffel Vandoorne was unable to start the race thanks to what is suspected to be a problem with the MGU-H on his Honda engine.
BAHRAIN GP RESULT
|5||Daniel Ricciardo||Red Bull/Renault||57||39.346s|
|7||Sergio Perez||Force India/Mercedes||57||1m02.606s|
|10||Esteban Ocon||Force India/Mercedes||57||1m35.711s|
|11||Pascal Wehrlein||Sauber/Ferrari||56||1 Lap|
|12||Daniil Kvyat||Toro Rosso/Renault||56||1 Lap|
|13||Jolyon Palmer||Renault||56||1 Lap|
|14||Fernando Alonso||McLaren/Honda||54||Power Unit|
|-||Carlos Sainz Jr.||Toro Rosso/Renault||12||Collision|
|-||Max Verstappen||Red Bull/Renault||11||Brakes|
|-||Stoffel Vandoorne||McLaren/Honda||0||Not started|
|9||Carlos Sainz Jr.||10|