Charles Leclerc bounced back from a spin to put his Ferrari on pole position for the Spanish Grand Prix.
Championship leader Leclerc lost control of his Ferrari through the chicane on his first attempt in Q3 at a sweltering Circuit de Catalunya on the outskirts of Barcelona to leave him sweating.
But the Monegasque kept his cool with his last effort to deliver an impressive lap under pressure and beat rival Max Verstappen by three tenths.
Verstappen, who trails Leclerc by 19 points, complained he had no power on his last attempt.
Carlos Sainz finished third in the other Ferrari, with George Russell fourth for Mercedes – two places and just over a tenth ahead of team-mate Lewis Hamilton.
“I only had one lap after I made a mistake, but I delivered and it makes me very happy,” said Leclerc.
“I am in a strong position to start the race. If we don’t manage the tyres well tomorrow we will lose the win because Max is right behind.”
Verstappen added: “I couldn’t do my final run as I just lost power.
“It is a bit of a shame but to be on the front for us is a good achievement, but of course I would have liked to have had that final run.”
Mercedes have brought a number of upgrades to Spain – including a revised floor and new front wing – and Russell impressed en route to fourth.
Russell is 23 points ahead of Hamilton after beating his seven-time world championship-winning team-mate at four of the five grands prix so far. And Russell left Hamilton trailing in qualifying, albeit six tenths back from Leclerc.
Hamilton so often reigns in Spain, with four of the last five Spanish GP poles and six wins – a record he shares with Michael Schumacher – but he has played second fiddle to team-mate Russell this weekend.
“This car just doesn’t talk to Lewis in the way that he likes a car to talk to him,” said respected pundit Martin Brundle in commentary for Sky Sports.
“We have had years of Lewis being absolutely precise everywhere and he is fighting, he doesn’t know what the car is going to do next.
“Lewis is having to hustle, and that is not how we are used to him driving a Mercedes. George seems to be able to be more precise with the car.”
Lando Norris found himself in unfamiliar territory after failing to make it into the top-10 shoot-out.
Norris’ best lap, which would have been good enough for Q3, was deleted after the young Briton exceeded track limits at Turn 12. He will line up in 11th for McLaren.
There was woe for Fernando Alonso on home soil as the double world champion was was knocked out in Q1.
Alonso stumbled over Norris in the final sector and failed to get over the line in time to complete his final lap.
The 41-year-old is set to line up a lowly 17th and will be joined at the back of the grid by both Aston Martin drivers.
Much has been made here of the heavily-revised Aston Martin machine and its likeness to the Red Bull.
But the British team showed no signs of improving on their lacklustre campaign, with Sebastian Vettel qualifying 16th and team-mate Lance Stroll two places further back.
“You must be kidding,” said a disbelieving Vettel after being informed he had failed to reach Q2.