Lewis Hamilton claimed pole for Formula 1's 2020 Russian Grand Prix despite nearly not setting a Q2 lap after Sebastian Vettel crashed, while Max Verstappen beat Valtteri Bottas to second.
Hamilton also faces a post-qualifying investigation for a track limits violation - along with Nicholas Latifi, Romain Grosjean and Kevin Magnussen - in Q1, and is the only driver in the top three who will start the race on the unfancied soft rubber as a result of his Q2 near-miss.
In that session, where spots of rain were reported early on, Mercedes sent both of its cars out on the medium tyres, as Red Bull did with Verstappen.
But both Hamilton and Bottas were forced to do second runs on the harder rubber as the former had his time deleted for a track limits violation at the final corner and the latter's first effort was underwhelming.
Bottas was then able set a time good enough to get him through to Q3, but Hamilton had to abort his second run when Vettel crashed at Turn 4 and the session was suspended.
The Ferrari driver appeared to clip the kerb on the inside of the right hander and the rear quickly got away from him, spinning into the wall on the outside and knocking his front wing - which was struck by the closely following Charles Leclerc - and his right front wheel.
When the session restarted, Mercedes sent Hamilton out on soft tyres, which means Bottas will start on the opposite strategy on the medium tyres along with Verstappen, who headed the pack urgently getting to the line to complete a final run with 2m15s on the clock after Vettel's crash.
Verstappen was also running softs and looked to be improving on his previous Q2 best on the mediums, but he abandoned his run so he will take the start on the harder rubber, which is expected to be a better race tyre in what will be a one-stop event.
Hamilton, who slid wide at Turn 2 on his out lap as he ran down the queue of cars desperately trying to make it into the top 10 shootout, crossed the line with barely a second remaining on the clock.
But he was able race around and get through with the fourth fastest time in Q2, which was headed by Ricciardo, with the last lap in the session and knocked out a frustrated Leclerc as a result.
In Q3, Hamilton led the way with a 1m31.391s, while Bottas had to close a 0.793s gap after the opening runs in the final shootout.
The Finn did improve on his final run, despite clouting the kerb at the exit of Turn 2, but was still 0.5s behind even before Hamilton completed his final lap - a 1m31.304s, which is a new track record and gives him his first pole in Sochi since 2014.
Verstappen set his final lap much later than the two Mercedes and was running fractionally behind Bottas in the opening two sectors before he surged ahead with a rapid final sector to join Hamilton on the front row.
Sergio Perez will start fourth ahead of Daniel Ricciardo and Carlos Sainz Jr, while Esteban Ocon, Lando Norris, Pierre Gasly and Alex Albon rounded out the top 10.
Daniil Kvyat took 12th for AlphaTauri ahead of Lance Stroll, who was pushed out of the queue before the urgent final Q2 laps with a suspected issue, and George Russell and Vettel.
Russell set his sole lap in Q2 when he ran solo during a mid-session lull before Vettel's crash and he went 0.5s quicker than his Q1 time, which had been enough to make it out of the opening segment for the first time in three races.
In Q1, Russell's last-gasp improvement to reach Q2 knocked out Romain Grosjean, who will start 16th, as the Ferraris scraped through in P14 and P15 in the opening segment.
Antonio Giovinazzi ended up 17th ahead of Magnussen and Latifi, who, along with Grosjean, went into the final Q1 runs without a time set after being among the group of runners - also including Hamilton and Gasly - who had their opening laps deleted for cutting the kerbs at Turn 2.
Kimi Raikkonen qualified last for the race where he will equal Rubens Barrichello's record for most F1 starts - assuming he takes the start on Sunday - after spinning on his final lap.
Raikkonen went into a 360 spin after striking the orange track limits deterrent kerb at the Turn 2 apex, which looped him around and he toured slowly around the inside of the ensuing long Turn 3 to avoid disrupting those cars following the Alfa Romeo.
F1 Russian GP qualifying results
Carlos Sainz Jr.
Get unlimited access to the world’s best motorsport journalism with Autosport Plus