Sebastian Vettel scored his first pole position this season at the Bahrain International Circuit after beating his Ferrari team-mate Kimi Raikkonen by 0.143 seconds.
Raikkonen had the advantage after the first runs in Q3 by 0.095 seconds from Vettel, but was unable to improve on his second run.
Vettel, who had a precautionary change of the control electronics of his power unit ahead of qualifying, set a lap of one minute, 27.958 seconds using the supersofts that were the tyre of choice to secure his 51st pole position in Formula 1.
Valtteri Bottas was third, just 23 thousandths of a second behind Raikkonen after making a two-tenths improvement on his final lap.
That put him just ahead of Mercedes team-mate Lewis Hamilton, who has a five-place grid penalty so is set to line up ninth place.
Hamilton was the only driver to set his Q2 time using soft-compound Pirellis, so he will start the race on that tyre.
Daniel Ricciardo was fifth fastest, almost two-tenths slower than Hamilton and nearly a second clear of the chasing pack.
Pierre Gasly put in a superb performance to secure his best qualifying result in Formula 1 with sixth place, and is set to move up to fifth on the grid thanks to Hamilton’s penalty.
Kevin Magnussen was just 29 thousandths of a second slower in seventh, with the Renaults of Nico Hulkenberg and Carlos Sainz Jr sandwiching the Force India of Esteban Ocon in ninth.
Brendon Hartley missed out on making it a double Toro Rossos in Q3 by less than a tenth of a second, after a small mistake in the final corner on his only effort in Q2 using fresh supersofts left him P11.
That put him just ahead of Sergio Perez’s Force India, with the McLarens of Fernando Alonso and Stoffel Vandoorne never looking to have top ten pace and ending up P13 and P14 after struggling for grip.
Max Verstappen lost the rear of his Red Bull and spun exiting the slow Turn 2 left-hander while on the fourth lap of his Q1 run.
He hit the barrier with his front wing and front left wheel, which led to the session being red flagged with five-and-half minutes remaining.
Verstappen ended Q1 fourth fastest, so technically made it to Q2, but was unable to run again after the crash and was classified P15 for Red Bull.
Romain Grosjean was fastest of those eliminated in Q1 despite setting an identical lap time to Alonso in the first segment of qualifying.
The Haas driver’s late one minute, 30.530 seconds lap during the five-and-a-half minutes of running after the red flag caused by Verstappen left him down in P16 and ranked behind Alonso, thanks to the McLaren driver setting his time first.
Grosjean subsequently complained over the radio about his outlap being “a mess”.
Sauber’s Marcus Ericsson failed to improve on his third and final Q1 run and ended up P17 ahead of Williams driver Sergey Sirotkin, who had to rely on his first-run time.
Charles Leclerc declared himself to be “so stupid” over the radio after spinning at the final corner on his last lap and ending up P19.
His best lap, set on the second of three sets of tyres as the Sauber drivers and Hartley managed to squeeze in two runs before the red flag, was just 0.006 seconds slower than Sirotkin.
Lance Stroll was slowest, the Williams driver just under a tenth slower than Leclerc.
So a fantastic qualifying result for Ferrari with Sebastian Vettel and Kimi Raikkonen locking out the front row. By sealing pole position, Sebastian has the a superb opportunity to score big points over rival Lewis Hamilton following a gearbox penalty. It’s going to be challenging for Mercedes to recover. Bring on the Bahrain Grand Prix!
Bahrain Grand Prix, qualifying results:
1 Sebastian Vettel Ferrari 1m27.958s
2 Kimi Raikkonen Ferrari 1m28.101s
3 Valtteri Bottas Mercedes 1m28.124s
4 Daniel Ricciardo Red Bull-Renault 1m28.398s
5 Pierre Gasly Toro Rosso-Honda 1m29.329s
6 Kevin Magnussen Haas-Ferrari 1m29.358s
7 Nico Hulkenberg Renault 1m29.570s
8 Esteban Ocon Force India-Mercedes 1m29.874s
9 Lewis Hamilton Mercedes 1m28.220s*
10 Carlos Sainz Renault 1m29.986s
11 Brendon Hartley Toro Rosso-Honda 1m30.105s
12 Sergio Perez Force India-Mercedes 1m30.156s
13 Fernando Alonso McLaren-Renault 1m30.212s
14 Stoffel Vandoorne McLaren-Renault 1m30.525s
15 Max Verstappen Red Bull-Renault –
16 Romain Grosjean Haas-Ferrari 1m30.530s
17 Marcus Ericsson Sauber-Ferrari 1m31.063s
18 Sergey Sirotkin Williams-Mercedes 1m31.414s
19 Charles Leclerc Sauber-Ferrari 1m31.420s
20 Lance Stroll Williams-Mercedes 1m31.503s
*Five-place grid penalty for changing gearbox