Carlos Sainz was the quickest driver before Charles Leclerc put it in the barrier.
Behind the Spaniard, Liam Lawson and Isack Hadjar lined up in P2 and P3.
As Leclerc put a scintillating effort to earn his ticket into Q3, which luckily did not end up in a crash, on his first lap in the final qualifying session, his good fortunes would run out.
As he approached Turn 15, Leclerc pushed it a bit too far. Braking ever deeper, he ran out of grip and understeered straight on into the barriers.
With Lewis Hamilton's elimination in Q2 with a P12 finish, this marked the end to Ferrari's qualifying session for the Azerbaijan Grand Prix, which had been marred by four previous flags.
Willimas last achieved pole position in 2014, thanks to Felipe Massa. As drivers emerged from the pits, they reported rain was falling. During the red flag period, the rain began to fall harder, which prompted Sainz to ask everyone at the Williams garage to start doing the rain dance.
Tune in for our coverage of the qualifying session here.