Championship leader Nico Rosberg takes a vital pole position for the European Grand Prix in Azerbaijan, as his Mercedes team-mate Lewis Hamilton crashed out in Q3.
Rosberg glanced the wall during his own final run at the Baku city circuit, but still did enough to claim the top grid slot by nearly eight tenths of a second.
The Canadian Grand Prix winner had earlier set the fastest time of all in the first sector but went off at Turn 15.
Hamilton regrouped and tried again, matching Rosberg’s pace in the first sector, but clipped the inside wall at Turn 12 and broke the front-right suspension on his Silver Arrows.
That caused the session to be red-flagged, and eventually left Hamilton down in tenth position, without having set a proper time in Q3.
It was a messy qualifying for the defending champion, who went off during each segment.
Sergio Perez therefore finished the session second quickest for Force India, but he will start seventh thanks to having to change the gearbox following a crash at the end of final practice.
Daniel Ricciardo and Sebastian Vettel set identical lap times, over four tenths down on the Force India, but Ricciardo takes the honour on the account of being first across the timing line so inherits the front row position.
“Oh come on, you’re joking!” rued Vettel, after Ferrari broke the bad news over team radio.
Kimi Raikkonen and Felipe Massa rounded out the top six, ahead of Daniil Kvyat, the Williams of Valtteri Bottas, and Max Verstappen’s Red Bull, who almost collided with Bottas during their first runs in Q3.
Romain Grosjean’s Haas came within a tenth of making the top ten, but ended the session P11, ahead of Nico Hulkenberg. The Force India driver spun on his first run in Q2 and was only P12 on his second attempt, complaining over team radio about a miscommunication of his run plan.
The Toro Rosso of Carlos Sainz Jr was P13, ahead of Fernando Alonso’s McLaren-Honda and Esteban Gutierrez, who went off at Turn 7 on his final flying lap.
Felipe Nasr got Sauber through to Q2 for the first time since the Chinese Grand Prix, but couldn’t go any quicker in Q2 so finished up P16.
Manor-Mercedes enjoyed a competitive qualifying session, but missed out on making the Q2 cut by less than two tenths.
Rio Haryanto was fractionally faster than Mercedes junior Pascal Wehrlein, and both were quicker than Jenson Button’s McLaren-Honda, which wound up P19 after backing out of his final flying lap in Q1.
He ended up 0.054 seconds down on Wehrlein and cursing over team radio.
Marcus Ericsson was P20 for Sauber, despite grazing a wall on his final lap, while Renault pairing Kevin Magnussen and Jolyon Palmer brought up the rear of the grid.
Qualifying standings, Baku:
1 Nico Rosberg Mercedes 1m42.758s
2 Daniel Ricciardo Red Bull-Renault 1m43.966s
3 Sebastian Vettel Ferrari 1m43.966s
4 Kimi Raikkonen Ferrari 1m44.269s
5 Felipe Massa Williams-Mercedes 1m44.483s
6 Daniil Kvyat Toro Rosso-Ferrari 1m44.717s
7 Sergio Perez Force India-Mercedes 1m43.515s*
8 Valtteri Bottas Williams-Mercedes 1m45.246s
9 Max Verstappen Red Bull-Renault 1m45.570s
10 Lewis Hamilton Mercedes 2m01.954s
11 Romain Grosjean Haas-Ferrari 1m44.755s
12 Nico Hulkenberg Force India-Mercedes 1m44.824s
13 Carlos Sainz Toro Rosso-Ferrari 1m45.000s
14 Fernando Alonso McLaren-Honda 1m45.270s
15 Esteban Gutierrez Haas-Ferrari 1m45.349s
16 Felipe Nasr Sauber-Ferrari 1m46.048s
17 Rio Haryanto Manor-Mercedes 1m45.665s
18 Pascal Wehrlein Manor-Mercedes 1m45.750s
19 Jenson Button McLaren-Honda 1m45.804s
20 Marcus Ericsson Sauber-Ferrari 1m46.231s
21 Kevin Magnussen Renault 1m46.348s
22 Jolyon Palmer Renault 1m46.394s
*Grid penalty due to a gearbox change