Sebastian Vettel dramatically grabbed pole position on Saturday for the 2019 Canadian Grand Prix at the Circuit Gilles Villeneuve in Montreal.
The German edged ahead of Formula One world champion Lewis Hamilton in the final moments of qualifying with a new track record.
Hamilton was searching for a seventh career pole in Canada but will start second on the grid after crossing the line 0.206 seconds slower than the Ferrari.
Charles Leclerc gained third as Valtteri Bottas had a disappointing final run of the day, ending qualifying in sixth.
Formula One provided the grid positions for Sunday's race:
A major crash for Kevin Magnussen at the Wall of Champions in Q2 meant Max Verstappen was unable to progress during the session, forcing the Red Bull driver down to 11th on the grid.
Magnussen picked up understeer that catapulted him into the wall as he corrected his direction.
Formula One highlighted the accident as the red flag was raised, with Hamilton going fastest through the session:
A long delay finally came to an end as Q3 got underway, and the Ferraris posted excellent runs.
However, Hamilton edged ahead of Vettel again, while Bottas spun his Mercedes at Turn 2, narrowly missing the wall.
More drama was to follow, with Hamilton ending his session with the Ferraris behind him on the track.
Leclerc was unable to beat the champion's best time, but Vettel produced a stunning lap to grab pole.
Vettel was clearly ecstatic with his team's effort on the radio and shared his joy as he entered the garage:
Hamilton has continued to show excellent pace, and he will not be too disappointed starting the race alongside Vettel on the front of the grid.
Ferrari stuttered through practice and qualifying before Vettel's sensational finish, and the Brit has the consistency to take maximum points with a steady drive.
Hamilton said he was content with Mercedes' prospects ahead of the race:
Ferrari have proved they have a fast car. However, their drivers have struggled to keep their performances in line with ambitions.
Vettel's track record was a welcome moment, but he will likely still have to hope Mercedes run into problems on Sunday to have any chance of winning.