Hamilton charged to his third pole position of the 2021 season - and his first since the Spanish Grand Prix in early May - at the Hungaroring on Saturday, leading a front row lock-out for Mercedes.
Hamilton's lap of 1m15.419s saw him finish three tenths clear of Mercedes teammate Valtteri Bottas, while title rival Max Verstappen finished four tenths off in third place.
But the end of qualifying saw both Mercedes drivers leave it late to cross the line to start their laps, with Verstappen just about managing to get across in time before the chequered flag.
His teammate, Sergio Perez, missed the flag and was unable to set a final lap, but qualified fourth nevertheless.
Hamilton was met with boos as he got out of his car on the main straight following his final lap, the booing growing heavier as he came to conduct his parc ferme.
Hamilton continued his parc ferme interview amid the boos, calling it "an amazing qualifying lap" that gave him pole position.
"I think it has been amazing teamwork from everyone this weekend, Valtteri included, just trying to push the car forwards, developing constantly," Hamilton said.
"The guys back at the factory just not left any stone unturned. So, it's been amazing to see everyone coming together and rallying up and pushing forward so, and I appreciate the great support I have here."
Hamilton then addressed the booing unprompted, saying: "Honestly I've never actually felt so great with the booing. If anything, it just fuels me, so I don't really mind it."
The seven-time world champion has faced abuse from some fans following his clash with Verstappen at Silverstone two weeks ago, the worst of which descended into racist messages that were condemned by those in F1.
Hamilton will enter Sunday's race chasing his 100th grand prix victory, and will run a different strategy to Verstappen, starting on mediums while the Red Bull begins the race on softs.
"I think the soft tyre is worth something like five metres down into down one, it's a long way down into Turn 1," Hamilton said.
"So yeah, it was surprising to see the guys behind us, most people, I think everyone in the top 10, on the soft except for us. We will see.
"It's definitely great having a lock-out for our team. It's the first time in a long time so big, big thank you to everyone back to the factory and.
"I hope the weather is good for everyone tomorrow, enjoy the sun and stay safe."