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.
HAM: "I wasn't hitting the apexs and was poor in braking zones. If Nico gets a good start tomorrow he'll be gone" pic.twitter.com/CekCRJOI8K- Formula 1 (@F1) June 18, 2016
"I couldn't tell you what the possibilities are for tomorrow," he said.
"It's damage limitation from here. The team made a change to something overnight, but I just wasn't was on it today."
Rosberg, understandably, was happier.
"It was great," he said. "That was one of the more challenging sessions out there, but everything worked out well.
"All weekend, we have been building towards this and qualifying was really optimum."
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 inh the drivers' title race to nine points.
On a hot dry afternoon in the Azerbaijan capital, where the track temperature fell gradually from 41 to 36 degrees Celsius, Jenson Button failed to make it past Q1 in his McLaren.
Unhappy about the safety of the circuit, the 2009 champion was eliminated along with Indonesian Rio Haryanto, who was a creditable 17th for Manor and his team-mate Pascal Wehrlein, 18th.
Button exited Q1, for the first time this year, in 19th.
Behind them, Swede Marcus Ericsson of Sauber was 20th ahead of the two Renaults of Dane Kevin Magnussen and Briton Jolyon Palmer.
In Q2, a spectacular spin by Force India's Nico Hulkenberg at Turn 16 wrecked his lap and, with it, Hamilton's, as the champion was behind him.
Rosberg rammed home his advantage with an impressive lap in 1:42.520, nearly two seconds faster than the rest.
This left Hamilton under pressure and it worsened when he locked up at Turn Seven on his next lap, leaving him with only seconds to spare to clock one that counted to lift him back to second amid a spate of yellow flags.
Out went Romain Grosjean of Haas, Hulkenberg, Carlos Sainz of Toro Rosso, Fernando Alonso of McLaren, Esteban Gutierrez in the second Haas and Felipe Nasr of Sauber.
That left the top-ten shootout with Rosberg emerging from it all smiles and Hamilton facing a monumental task to make it three wins in a row on Sunday.