Saturday's qualifying session for the 2017 F1 Bahrain GP comes to an end. Here are the results.

Hamilton had taken pole for each of the first two F1 races of 2017 and led the way again through Q1, Q2 and the initial runs in Q3, but Bottas hit the top spot on his final run with a lap of 1m28.769s.

Hamilton dropped a chunk of time in the second sector of his final lap, and also had an oversteer moment at the final corner, so failed to improve. He ended up second fastest by just 0.023 seconds.

Ferrari's Sebastian Vettel was almost half a second further back in third, saying he "tried a bit too hard" on his final Q3 run, which was slower than his first.

Daniel Ricciardo's Red Bull split the two Ferraris by setting the fourth fastest time on his final run, just 0.022s clear of Kimi Raikkonen.

Max Verstappen was a tenth further back in the second Red Bull, while works Renault driver Nico Hulkenberg beat Felipe Massa's Williams to the seventh fastest time, with a lap that was within two tenths of Verstappen's.

Romain Grosjean again got the Haas team into Q3, ending up eighth fastest, well down on Massa and three tenths clear of Jolyon Palmer's Renault.

Palmer made Q3 for the first time in his F1 career, but eventually qualified over 1.2s down on Renault teammate Hulkenberg.

Sebastian Vettel, Ferrari SF70H
Valtteri Bottas, Mercedes AMG F1 W08

Toro Rosso's Daniil Kvyat missed out on making the top-10 shootout by less than half a tenth of a second, after running wide at the final corner and failing to improve on his final Q2 run.

Lance Stroll made only one run after his Williams spent a long period receiving adjustments in the garage and he ended up only 12th fastest.

Returnee Pascal Wehrlein qualified a brilliant 13th in the Sauber, on a track he starred at last season for Manor, ahead of the Force India of fellow Mercedes junior Esteban Ocon, and the McLaren-Honda of Fernando Alonso, who didn't set a time in Q2 after "we broke the power unit".

Alonso scraped his McLaren-Honda into Q2 thanks to the Toro Rosso of fellow Spaniard Carlos Sainz stopping at the final corner in the dying moments of Q1.

This relegated Sainz to 16th thanks to rivals earlier improving their times, and it also forced Sergio Perez to back off while on a hot lap in his Force India.

Perez still improved by nearly four tenths of a second, but this still left him down in 18th place, 0.005s behind the second McLaren-Honda of Stoffel Vandoorne, who outpaced Alonso fractionally during the initial runs in Q1.

Marcus Ericsson was only 19th quickest, over half a second slower than Sauber teammate Wehrlein, while Haas's Kevin Magnussen qualified slowest of all after aborting his final flying lap for the yellow flags displayed for Sainz's stricken Toro Rosso.

Post Driver Chassis Engine Time Gap
1 finland Valtteri Bottas  Mercedes Mercedes 1'28.769  
2 united_kingdom Lewis Hamilton  Mercedes Mercedes 1'28.792 0.023
3 germany Sebastian Vettel  Ferrari Ferrari 1'29.247 0.478
4 australia Daniel Ricciardo  Red Bull TAG 1'29.545 0.776
5 finland Kimi Raikkonen  Ferrari Ferrari 1'29.567 0.798
6 netherlands Max Verstappen  Red Bull TAG 1'29.687 0.918
7 germany Nico Hulkenberg  Renault Renault 1'29.842 1.073
8 brazil Felipe Massa  Williams Mercedes 1'30.074 1.305
9 france Romain Grosjean  Haas Ferrari 1'30.763 1.994
10 united_kingdom Jolyon Palmer  Renault Renault 1'31.074 2.305
11 russia Daniil Kvyat  Toro Rosso Renault 1'30.923 2.154
12 canada Lance Stroll  Williams Mercedes 1'31.168 2.399
13 germany Pascal Wehrlein  Sauber Ferrari 1'31.414 2.645
14 france Esteban Ocon  Force India Mercedes 1'31.684 2.915
15 spain Fernando Alonso  McLaren Honda    
16 spain Carlos Sainz Jr.  Toro Rosso Renault 1'32.118 3.349
17 belgium Stoffel Vandoorne  McLaren Honda 1'32.313 3.544
18 mexico Sergio Perez  Force India Mercedes 1'32.318 3.549
19 sweden Marcus Ericsson  Sauber Ferrari 1'32.543 3.774
20 denmark Kevin Magnussen  Haas Ferrari 1'32.900 4.131

Gallery: 2017 F1 Bahrain GP