Baku - Nico Rosberg will start on pole for the inaugural European Grand Prix in Baku with his Mercedes team-mate Lewis Hamilton only 10th after a calamitous qualifying session on the tricky street circuit on Saturday.
Hamilton was quickest in all three practice sessions but the world champion had an error-strewn qualifying culminating in him crashing his Mercedes in Q3.
Rosberg took full advantage of Hamilton's misfortune.
The championship-leading German clipped the wall on his fastest lap in Q3 on his way to a lap in one minute and 42.758 seconds after Hamilton did the same, but more severely in the track's narrowest section, damaging his front right tyre.
Hamilton was forced to pull up and, as he walked away, the session was red-flagged to a halt with two minutes remaining as marshals cleared the debris.
When the action resumed, Sergio Perez wound up second fastest for Force India, but the Mexican will start from seventh after picking up a five-place penalty for a gearbox change after crashing in the final free practice.
This meant that Australian Daniel Ricciardo, who was third for Red Bull, will start Sunday's race alongside Rosberg on the front row.
The two Ferraris of four-time champion Sebastian Vettel and Kimi Raikkonen were fourth and fifth ahead of Felipe Massa of Williams, Daniil Kvyat of Toro Rosso and Valtteri Bottas in the second Williams.
Dutch teenager Max Verstappen was ninth in the second Red Bull ahead of Hamilton, who after wins in Monaco and Montreal has trimmed Rosberg's lead in the drivers' title race to nine points.
The starting grid for Sunday's European Grand Prix in Baku following the final qualifying sessions on Saturday:
Nico Rosberg (GER/Mercedes)
Daniel Ricciardo (AUS/Red Bull)
Sebastian Vettel (GER/Ferrari)
Kimi Raikkonen (FIN/Ferrari)
Felipe Massa (BRA/Williams)
Daniil Kvyat (RUS/Toro Rosso)
Sergio Perez (MEX/Force India)
Valtteri Bottas (FIN/Williams)
Max Verstappen (NED/Red Bull)
Lewis Hamilton (GBR/Mercedes)
Romain Grosjean (FRA/Haas)
Nico Hulkenberg (GER/Force India)
Carlos Sainz Jr (ESP/Toro Rosso)
Fernando Alonso (ESP/McLaren)
Esteban Gutierrez (MEX/Haas)
Felipe Nasr (BRA/Sauber)
Rio Haryanto (INA/Manor)
Pascal Wehrlein (GER/Manor)
Jenson Button (GBR/McLaren)
Marcus Ericsson (SWE/Sauber)
Kevin Magnussen (DEN/Renault)
Jolyon Palmer (GBR/Renault)