Ferrari's Carlos Sainz snatched pole position for the British Grand Prix from Max Verstappen with the last lap of a thrilling wet qualifying session.
Verstappen looked favourite for pole in treacherous conditions at Silverstone after topping the first two sessions.
But Sainz snuck ahead by just 0.072 seconds at the end of the top-10 shootout, with his Ferrari team-mate Charles Leclerc in third.
Mercedes' Lewis Hamilton took fifth, behind Red Bull's Sergio Perez.
Sainz, who had been slower than Leclerc for much of the session, giggled in disbelief over the team radio as he was told he had taken pole. "I didn't expect that one," he laughed, saying how difficult conditions had been.
It was another strong performance from the Spaniard after he pushed Verstappen all the way for victory in Canada last time out, losing out by less than a second.
Sainz was cheered by the huge Silverstone crowd as he began his qualifying interviews and said: "I was struggling with the standing water and it was easy to lose the car and lose the lap.
"That didn't feel too good but in the end it was pole position and a bit of a surprise."
The difficulty of the conditions was underlined by Verstappen making a couple of mistakes early in the final session, spinning out of Stowe on his first flying lap, and then misjudging his braking and running too deep into Vale on his next.
Nigel Mansell congratulated SainzWhen he started to put it together after that, the Dutchman looked in imperious form, but a yellow flag forced him to back off on his final lap and deprived him of the chance to try to snatch pole back from Sainz.
"It was raining, drying, you had to be on the track at the right time," Verstappen said.
"Overall the car was working really well. In Q3, it is always a bit of lottery. I got a bit hindered on my final lap with the yellow flag but to be on the front row is good for us, and we have a good race car in the dry and in the wet."
Leclerc, too, had a spin - and his was costly, as it came on his final lap and he, like Verstappen was pushing to overhaul Sainz.
"Happy for Carlos," Leclerc said. 'He did a great job today, I spun in the last lap. I knew it was the lap I had to put everything together and I didn't so I didn't deserve to be on pole."
Leclerc has admitted this weekend that he needs to win on Sunday to revive his title hopes after seeing his early-season title race lead turn into a 49-point deficit to Verstappen in recent races.
Russell on bouncing cars, Hamilton and SilverstoneA mini Mercedes revival
Mercedes appear to have made a step forward at Silverstone after introducing some upgrades aimed at increasing their car's downforce.
Hamilton was in the hunt at the front for much of qualifying, vying with Verstappen and Leclerc, with team-mate George Russell also in the frame.
But both slipped back in the final seconds of qualifying and Hamilton ended up a second off pole - further than it had looked like he would be.
Hamilton said: "Oh man I was having so much fun out there. I was fighting for the front row and I knew I had the pace. The team told me to back off on the second to last lap and push on the last lap but it rained more on the last lap and it was slower. But that's racing."
Russell was in eighth, less than 0.2secs behind Hamilton, saying he had the pace to be fourth or fifth but had made a mistake on his final lap.
In between them were strong performances from Lando Norris in the McLaren and Fernando Alonso, who followed up his brilliant front-row qualifying in the Alpine in Canada with another powerful showing.
Chinese Zhou Guanyu, impressive throughout in the Alfa Romeo, was ninth, with team-mate Valtteri Bottas down in 12th.
And there was another standout performance from the man in 10th place.
Canadian Nicholas Latifi not only equalled his best ever qualifying performance in the Williams, but did so despite being deprived of the major car upgrade that was put only on team-mate Alex Albon's car.
Albon was knocked out in the first session and lines up 16th.