Max Verstappen will start from pole for the Canadian Grand Prix, with Nico Hulkenberg finishing Qualifying in a shock second place.
The effort from Hulkenberg came just six seconds before a red flag was put out for Oscar Piastri, who crashed at the exit of Turn 7 on his attempt.
However, Hulkenberg will start Sunday's race from P5, after he was demoted three places for exceeding the speed limit under red flag conditions.
All drivers had to negotiate tricky conditions on the Intermediate tyres, with Verstappen managing a best time of 1:25.858s that was 1.2s faster than Hulkenberg.
Fernando Alonso thought he had just missed out on a potential front row start as he was next to cross the line after Hulkenberg before the red flag came out. Due to the German's penalty, however, Alonso will start from P2 ahead of the two Mercedes drivers.
Carlos Sainz was the sole Ferrari in Q3 after Charles Leclerc dropped out due to a tyre error in Q2. His attempt was only good enough for P8 but he too was dropped three places after impeding Pierre Gasly in Q1.
Perez misses out on Q3 for third race in a row
When the second part of qualifying started a clear dry line had appeared on the track from the running in Q1, although only Alex Albon elected to make the gamble at the start of the session.
It turned out to be the best strategy as he shot up the timing screen and set the quickest time, prompting others to make the switch from Intermediates.
Sergio Perez and Leclerc were among the last to make the switch and as they did it, the rain started to appear again at parts of the track.
Despite a desperate attempt to salvage any lap, it was too late for any improvement from both drivers as they struggled to stay on track in the tricky conditions.
Leclerc blamed his team for not having the tyres ready post-session over the radio for his P10 start, while Perez was also left missing out on Q3 for a third race in a row.
Lance Stroll also missed out on Q3 and will start from P16 at his home race, after spinning on an earlier attempt and damaging his front wing. This prompted an extra stop in the pits which wasted time as the rain hit the track, and the Canadian was another to be slapped with a three-place grid drop for blocking.
Gasly suffers shock exit as Tsunoda gets investigated twice
Gasly was the shock exit from qualifying in Q1 after the Alpine driver came across a slow Carlos Sainz at the final corner on his last attempt. The Frenchman voiced his frustration over the team radio as he took to the escape road and had to abort the lap.
He will start from P16, after Yuki Tsunoda became yet another driver to be issued with a three-place grid drop for two separate impeding incidents relating to Leclerc and Hulkenberg.
There has yet to be a session so far this weekend without a red flag and minutes into Q1 that trend continued when Zhou Guanyu stopped on track with a problem.
While he stopped off track at a marshals' post, he managed to get back underway after consulting his team and made his own way back to the pits.
Even though he participated in the rest of the session, the Chinese ultimately qualified in P20.