Valtteri Bottas brilliantly denied Lewis Hamilton pole position in a dramatic Azerbaijan GP qualifying as Mercedes again upstaged Ferrari, who saw Charles Leclerc crash out.
Ferrari had comfortably appeared favourites for the front row before the session but, not for the first time this year, their promise evaporated when it mattered most.
Practice pacesetter Leclerc crashed out in Q2, while Sebastian Vettel was outpaced by both Bottas and Hamilton as the trio vied for the leading position on the final lap. Bottas' lap of 1:40.495 - a track record - won pole by a margin of 0.059s.
"Another day in this 2019 season that coulda, shoulda, woulda been Ferrari's day turned out to be Mercedes'," said Sky Sports F1's David Croft.
Leclerc will start down in ninth after the 21-year-old got caught out at the narrow castle chicane of Turn Eight and slammed into the barriers.
"I am stupid, I am stupid," raged Leclerc on team radio as he rebuked himself. He stood by his harsh self-criticism when speaking to Sky F1 afterwards, while added on social media that his performance had been "useless".
"For the next three or four hours I will be beating myself up," added Leclerc.
That incident, plus a near-identical shunt for Williams' Robert Kubica in Q1, meant qualifying was twice suspended and ultimately ran for nearly two hours as temperatures dropped sharply around Baku's city streets.
Max Verstappen qualified a very competitive fourth for Red Bull after setting the pace in Q2, while Baku expert Sergio Perez secured a brilliant, season-best fifth for Racing Point.
Daniil Kvyat for Toro Rosso and McLaren's Lando Norris, making Q3 for the third time in four attempts, completed the top seven ahead of the Alfa Romeo drivers, Antonio Giovinazzi and Kimi Raikkonen.
Giovnazzi joined Raikkonen in the top 10 for the first this year, outqualifying the more experienced Finn, but will drop down the grid owing to a 10-place penalty for engine changes. Red Bull's Pierre Gasly, who was quickest in Q1, sat out Q2 ahead of his pit-lane demotion for missing the weighbridge in practice.
Renault, meanwhile, endured a horrid session as neither of their cars made the top 10. Daniel Ricciardo finished 12th, while Nico Hulkenberg dropped out in Q1.
Mercedes make a mockery of own prediction
Whether or not playing mind games, Mercedes boss Toto Wolff said before qualifying that Ferrari were "almost untouchable" for pole position given the Scuderia had dominated practice.
Yet during the course the incident-filled, marathon qualifying session that followed the performance pendulum swung away from Ferrari and towards their biggest rivals and the championship leaders.
"I don't know if they stole it, I think they were a bit quicker than us today," conceded Vettel, who finished 0.3s adrift of pole.
"For me it started a bit slow, towards the end it was getting better but it was quite tricky, the session was very long, the sun was going down. It was difficult to find the right balance of pushing in the out lap and playing with tow."
Bottas said: "It's all about small margins and I got a good tow on the last lap. The corners I had to drive as well but it's fine details and I hit the sweet spot."
That makes it two poles in a row for Bottas this year but Hamilton, who beat his team-mate off the line a fortnight ago in China, was more than satisfied to play his part in the unexpected Silver Arrows lockout.
"Honestly I did not think I would be on the front row today," the world champion told Sky F1. "I'm always hopeful but the Ferraris were showing pace we couldn't really truly match. I don't know what happened to Seb, I think he didn't get a tow which was where he was missing out as that's worth four or five tenths.
"We'll definitely take it, should have been on pole but Valtteri did a great job. I fluffed Turn One and Two, I came out of Turn Two three tenths down to my previous lap."
Watch the Azerbaijan GP live on Sky Sports F1 on Sunday at 1pm. Sky Sports is the home of live and exclusive F1. Find out more here to watch the 2019 season live