George Russell claimed the first pole position of his Formula One career for Sunday's Hungarian Grand Prix.
The 24-year-old edged out Ferrari's Carlos Sainz by just 0.044 seconds, with Charles Leclerc third.
Russell's Mercedes team-mate Lewis Hamilton qualified seventh after aborting his final flying lap, with championship leader Max Verstappen 10th on the grid after he suffered with mechanical problems.
The 2021 world champion locked up at Turn 2 on his opening run in Q3, finishing 1.7 seconds behind, and then reported he had no power as he geared up for his final attempt. "Nothing works," he yelled, unable to improve on his first Q3 attempt.
Mercedes struggled for pace in practice but Russell pulled out one of the laps of his career - finishing eight tenths clear of Hamilton - to take the front spot for Sunday's 70-lap race.
"I am over the moon," said Russell. "That last lap was mega. I came across the line and saw P1 and it was an incredible feeling.
"There are no points for qualifying but we are going to be absolutely going for it. It has been a special day."
Lando Norris took fourth for McLaren, one place ahead of Alpine's Esteban Ocon.
On a poor afternoon for Red Bull, Verstappen's team-mate Sergio Perez took aim at Haas driver Kevin Magnussen after he finished 11th.
Perez claimed the Dane disrupted his speediest lap, saying over the radio: "F****** Magnussen. Yeah I was blocked there by Magnussen."
Sebastian Vettel announced he will bring the curtain down on his Formula One career at the season's final race in Abu Dhabi on 20 November.
After winning four consecutive titles for Red Bull between 2010 and 2013 he failed to deliver the championship in a five-season spell before he joined Aston Martin.
But his one-and-a-half year spell with the British team has been disappointing, and there was further woe here when he crashed in final practice.
Vettel worked alongside his mechanics to repair his wounded machine in time for qualifying, but the German failed to make it out of Q1, qualifying 18th.
Nicholas Latifi was the surprise name at the top in Saturday's rain-hit practice but, in the dry, the Canadian finished 20th and last.