Sebastian Vettel pipped Ferrari team-mate Kimi Raikkonen to pole for the Chinese Grand Prix.
Raikkonen, who had looked the strongest of the pair all weekend, was on provisional pole when the chequered flag fell in qualifying, but a last minute effort from Vettel put the four-time champion ahead by just 0.087s.
Both Ferraris were comfortably ahead of the Mercedes duo, with Valtteri Bottas half a second back in third.
Reigning champion Lewis Hamilton appeared to struggle with the cooler conditions and could only manage fourth fastest.
It was a phenomenal effort from the Red Bull team to get Daniel Ricciardo out for qualifying after an engine failure in the final free practice session. The Australian joined the track with just three minutes on the clock in the first qualifying session and narrowly avoided the first knockout zone with a time that was only good enough for 14th.
With a little more time and a little less pressure, Ricciardo managed to make it through to Q3 – albeit with ultra-soft tyres compared to the softs of Ferrari and Mercedes – and qualified P6, just behind team-mate Max Verstappen.
Nico Hulkenberg picked up best of the rest ahead of the Force India of Sergio Perez.
Carlos Sainz Jnr, who only made it out of Q2 by a hundredth of a second, finished ninth ahead of Romain Grosjean.
All the drivers who qualified in the top 10 will start tomorrow’s race on the ultra-soft compound of tyre with the exceptions of Mercedes and Ferrari, who managed to make it through Q2 on the soft tyre.
Outside the top 10, Kevin Magnussen picked up P11 ahead of Esteban Ocon, Fernando Alonso, Stoffel Vandoorne and Brendon Hartley.
Sergey Sirotkin narrowly missed out on making it into Q2 but managed to out-qualify team-mate Lance Stroll. They finished P15 and 17 with the Toro Rosso of Pierre Gasly splitting the duo. Sauber’s Charles Leclerc and Marcus Ericsson complete the order.