Valtteri Bottas led Lewis Hamilton to a Mercedes one-two in a chaotic Azerbaijan Grand Prix qualifying as Ferrari's challenge crumbled.
Charles Leclerc had looked favourite but Ferrari's new star crashed in second qualifying and will start ninth.
"I am stupid," Leclerc said on the team radio before saying on social media: "No excuses. I've been useless. I will push to have a better tomorrow."
His team-mate Sebastian Vettel was third, 0.302 seconds off the pace.
It was a madcap session, with two lengthy stoppages for accidents, the other to Williams' Robert Kubica, and a number of drivers getting away with brushing the walls around the challenging Baku street circuit - including Vettel, who hit the inside wall at Turn Eight in the same session as Leclerc's accident but was able to continue.
Through it all, the imperious Mercedes machine rose to the front, taking their second front row lock-out in succession and putting themselves in a strong position for their fourth consecutive one-two race finish in four races so far this season.
After Leclerc's crash, it was unclear who was the new favourite for pole, but Hamilton went fastest on the first runs in final qualifying, 0.4secs faster than anyone else.
However, at the start of the final runs, Mercedes were tight on time to get round to start their final laps before the chequered flag and Hamilton appeared to be compromised by being too close behind Bottas.
He immediately lost 0.3secs in the first sector and despite making up time on the next two parts of the lap, Bottas just managed to sneak ahead and Hamilton ended up 0.059secs behind the Finn.
- Azerbaijan Grand Prix qualifying results
- The secret aerodynamicist
- F1 title race banking on Baku surprises
- What does Verstappen do on weekends off?
Fast Ferrari mess it up again
It was a grave disappointment for Ferrari, for whom Leclerc had been the form man from the start of the weekend.
Leclerc again looked quick in first qualifying, although Red Bull's Pierre Gasly pipped him to fastest time with a later lap, and the 21-year-old was quick on his first lap on medium tyres in second qualifying, with Ferrari preferring them for the start of the race, only to smash into the wall at Turn Eight on his second lap.
Leclerc went in too fast to the tight left-hander leading into the section around Baku's historic medieval castle, locked a wheel and understeered into the barriers.
He was clearly dejected as he climbed out of the car and looked to the skies in dismay.
"I am very disappointed in myself," Leclerc said. "I have been very strong all weekend but it is a mistake I shouldn't have done. I will focus on that for a few hours and understand what I could have done to not have that mistake but I will push to come back and have a good race tomorrow."
Leclerc's pace on his first lap was strong enough to get him through into the top 10 shoot-out but he could not take part as a result of the extensive damage to his car.
But because Alfa Romeo's Antonio Giovinazzi has a 10-place grid penalty, Leclerc will be promoted to start ninth. From there, on a divergent strategy starting on the medium tyres, he is likely to feature in the fight for a podium by the end of the race.
A madcap weekend so far
Red Bull's Max Verstappen was fourth, 0.574secs off the pace, ahead of Racing Point's Sergio Perez, Toro Rosso's Daniil Kvyat and McLaren's Lando Norris, who continued the impressive start to his debut season with seventh place.
At the back, George Russell impressed to out-qualify team-mate Kubica despite missing all his Friday running after his car was damaged when he ran over a loose man-hole cover.
Russell was 0.393secs quicker than Kubica, who ended his session in the wall at Turn Eight, misjudging his entry, hitting the inside wall and cannoning into the barrier on the outside.
The session continued the theme of a madcap weekend, which started with first practice being cancelled following Russell's incident so organisers could check the rest of the manhole covers around the track, and then the lorry bringing his car back to the pits colliding with a bridge.
The first race in Baku in 2016 was a snore-fest, but the last two have been full of incident, and the weekend so far has suggested another unpredictable and incident-strewn race is in store.
What they said
Bottas said: "I am really happy. Ferrari have been really strong. Charles was out by a mistake and as a team we did everything to take an advantage."
Hamilton said: "It has been so close all weekend. Ferrari have looked incredibly quick. Valtteri did an exceptional job in qualifying. It is a massively great result for us. We didn't have an upgrade and there others did and for us to lock out the front row due to circumstances I am really grateful for it."
Vettel admitted Ferrari were disappointed with the result.
He said: "I don't know if they stole it. I think they were a bit quicker than us today. It was difficult to find the ring balance of pushing with the out lap and playing with two and trying to get something. I had a good lap but I had no tow.
"Happy to get sort of the maximum out of it but from a team point of view we were expecting to have a better session."