Lewis Hamilton claimed pole position for Formula 1's 2020 Hungarian Grand Prix ahead of his Mercedes team-mate Valtteri Bottas and Racing Point duo Lance Stroll and Sergio Perez.
Behind the four Mercedes-powered cars came Ferrari, which collected its best qualifying result of 2020 so far with fifth and sixth, as Red Bull could only manage seventh with Max Verstappen, while Alex Albon was knocked out in Q2.
Hamilton set the pace on the first runs in Q3 after both Mercedes and both Racing Point drivers had made it through to the final segment on the medium tyres, which they will all start Sunday's race on.
Bottas needed to close a 0.4s gap on the final laps and although he did improve, Hamilton did likewise and roared to his 90th career F1 pole with a 1m13.443s, with his team-mate 0.107s adrift.
The works Mercedes were the only cars able to get under the 1m14s barrier, with Stroll third on a 1m14.377s.
Perez had his first run in Q3 deleted for a track limits infringement at the exit of Turn 4, but he slotted in fourth on his final lap.
Sebastian Vettel beat Charles Leclerc to fifth, with the Ferraris set to be the first of the top 10 runners to start the race on the soft rubber.
It is the first time in 2020 that both Ferraris have made it through to Q3.
Verstappen ended up seventh, almost a second down on Hamilton's best time, after complaining about the handling of his RB16 in the medium-speed corners.
McLaren duo Lando Norris and Carlos Sainz Jr took eighth and ninth, with AlphaTauri's Pierre Gasly rounding out the top 10.
Sainz was investigated for impeding Antonio Giovinazzi at the chicane in Q1 when the Alfa Romeo driver was on a flying lap, but the stewards took no further action.
Although Sainz passed two marshals posts displaying blue flags, there was no blue light panel. The stewards accepted he could not see the first blue flag and did not have enough time to react to the second blue flag, due to his position on the track.
Gasly, who missed all of FP1 with an engine issue, complained of power problems in both of the opening segments, but did not set a time in Q3 after suggesting his power unit would not be able to go further in qualifying as he completed his final run in Q2.
Daniel Ricciardo qualified 11th, unable to beat his first run in Q2 set on the mediums after he switched to the softs, but the Renault driver will nevertheless have free choice of starting rubber for the race.
George Russell was delighted to make it in Q2 for the second race in a row and he equalled his best qualifying result with P12 - the same place he qualified at last weekend's Styrian GP - ahead of the second Red Bull of Albon.
After complaining about the balance of his car throughout practice and qualifying, Albon ended up in 13th, 0.207s behind Gasly's cutoff time in the second segment, and criticising his team after encountering traffic on his final Q2 lap.
Like his Renault team-mate Ricciardo, Esteban Ocon tried the mediums early on Q2 and although he improved his personal best after switching to the softs he will start 14th ahead of Nicholas Latifi.
In Q1, Latifi had made it through to make it two Williams cars into the second stage of qualifying for the first time since the 2018 Italian GP.
Kevin Magnussen and Daniil Kvyat could not improve enough in the final laps, which were characterised by significant track evolution and tumbling times that meant all drivers went for a final effort.
Haas driver Magnussen ended up P16, with the AlphaTauri just behind, while Romain Grosjean qualified 18th in the second Haas.
The Alfa Romeo drivers will start last - with all four Ferrari customer cars knocked out in Q1 - with Giovinazzi ahead of team-mate Kimi Raikkonen.
Giovinazzi lost a time early in Q1 - which was topped by Perez and Stroll - for a track limits infraction at Turn 4, the fast left-hand kink at the start of the second sector.
Hungarian Grand Prix - Qualifying Times
|3||Lance Stroll||Racing Point/Mercedes||0.930s|
|4||Sergio Perez||Racing Point/Mercedes||1.098s|
|7||Max Verstappen||Red Bull/Honda||1.402s|
|9||Carlos Sainz Jr.||McLaren/Renault||1.580s|
|13||Alexander Albon||Red Bull/Honda||2.268s|
|19||Antonio Giovinazzi||Alfa Romeo/Ferrari||3.059s|
|20||Kimi Raikkonen||Alfa Romeo/Ferrari||3.167s|