It's a Mercedes front-row lock-out for Sunday's race, with Bottas second best with Red Bull's Max Verstappen and Sergio third and fourth respectively.
However, the talking point were the games played by Hamilton with his championship rival in the final minutes of the session.
Heading out for the final flying laps, the Mercedes driver trundled out of the pits and onto the track, seemingly intentionally delaying the Red Bull.
Of the front runners, Bottas was the first to bank a time as qualifying began, recording a 1:16.610s.
That was soon bested by Hamilton, who recorded a 1:16.424s, only for Verstappen to edge in front with 1:16.214s.
Following the opening runs, Perez found himself just ninth and a second away from the pace set by his team-mate.
Carlos Sainz found himself fourth best, though with a question mark after he was caught on the apex of Turn 1 trying to get out of the way as an AlphaTauri raced by.
Perez went again in an effort to improve his time, a messy lap leaving him marginally faster on the stop watch but no better off on the leaderboard.
As the chequered flag fell, Daniel Ricciardo sat 13th, slipping to 14th as Kimi Raikkonen completed his lap to slot in ahead of the Australian.
Behind him, Yuki Tsunoda, George Russell, Nicholas Latifi, and Nikita Mazepin failed to make the cut, while Mick Schumacher never got out on track after his Practice 3 crash.
Perez began Qualifying 2 on a set of medium compound tyres, the preferred race rubber come Sunday, capable only of a 1:17.203s.
The early pace was set by Hamilton, 1:16.553s for the Mercedes driver to hold a 0.2s advantage over Verstappen.
Only the two Red Bulls and two Mercedes elected for the yellow-walled tyres, the balance of the field all fitting a set of softs from the outset.
It was enough to see Sebastian Vettel rise to third fastest with a 1:16.972s.
Pierre Gasly sat fourth with Bottas only fifth after his first run, Perez having been demoted to sixth.
That became seventh when Fernando Alonso set a 1:16.906s to inch ahead of his former Ferrari team-mate to claim third.
That lasted until Charles Leclerc went second fastest, a time recorded seconds before the red flag was shown when Sainz hit the wall at the final corner.
The Spaniard was able to keep the car running and limped away before having to stop, the front wing tucked under the car.
A snap of oversteer on entry of the final corner sent the Ferrari around, slamming into the barrier with the left-rear wheel before the front followed it in.
The session restart with just over six minutes to run in the segment, nobody heading out.
In the drop zone were Lando Norris, Lance Stroll, Raikkonen, Sainz (whose fate was therefore sealed), and Antonio Giovinazzi.
With just under four minutes to run, all 14 remaining runners took to the circuit.
All bar Bottas had a set of soft compound tyres fitted, including Hamilton and both Red Bulls.
Gasly went fastest, 1:16.394s only for Verstappen to lower that to 1:15.650s, locking him in to the soft compound tyres for Sunday's race.
Missing the cut were Sainz, Giovinazzi, Raikkonen, Stroll, and Ricciardo who slipped to 11th having sat eighth after completing his lap.
A mistake saw him clout the sausage kerb at the chicane, pushing him wide to cost him time, likely the difference as he missed out on progressing by 0.08s.
Norris in the other McLaren rose to second fastest, 1:16.385s as Hamilton dropped to sixth and Bottas eighth, neither improving to ensure they'll start the grand prix on medium tyres.
All bar Vettel headed out as Qualifying 3 got underway, the Aston Martin team adopting its usual offset approach.
Norris had a used set of soft tyres fitted, recording a 1:16.877s, the slowest of the early laps in the session.
At the other end of the timing screen, Bottas logged a 1:15.734s, Hamilton improving on that to 1:15.419s.
Verstappen could muster only a 1:15.984s, a lap which had been fastest before the two Mercedes usurped it.
Vettel began his timed lap as the field returned to the pits, the Aston Martin left with the Hungaroring to himself.
He duly recorded a 1:16.750s to slot in eighth, completing the lap moments before the remainder of the field returned to the track for a final flying lap.
Verstappen joined the pit lane behind Hamilton, the Mercedes driver crawling and looking as though he was deliberately holding up the Red Bull.
That carried on as they joined the road, the games ultimately costing Perez.
Tight for time as they reached the line, the Mexican failed to reach the flag time ran out, Verstappen having only narrowly made it through.
Hamilton's final flying lap was unspectacular, unable to improve on his earlier effort.
The same was also true of Bottas up the road, the Finn ending the session second to his team-mate with Verstappen third and Perez fourth.
Fifth went to Gasly with Norris in sixth, then Leclerc, Esteban Ocon, Alonso, and Vettel rounding out the top 10.
Hamilton's antics were not welcomed by the fans, who booed Hamilton as he stepped from the Mercedes, cheering Verstappen has he hopped out of his Red Bull.
Sunday's race, which will see mixed strategies from the leading two teams, gets underway at 23:00 AEST.
Results: Formula 1 Hungarian Grand Prix, Qualifying
|Red Bull Racing
|Red Bull Racing