Lewis Hamilton beat Valtteri Bottas to a Mercedes one-two ahead of Red Bull's Max Verstappen in Hungarian Grand Prix qualifying.
The seven-time champion then brushed off boos from thousands of Dutch fans and dismissed accusations from Red Bull of gamesmanship as "silly".
The session sets up an intriguing race, with the Mercedes drivers starting on a different tyre from Verstappen.
And Hamilton described his first pole lap since early May as "amazing".
- Hungarian Grand Prix coverage on the BBC
- Full qualifying results
- Red Bull's Hamilton penalty appeal rejected
He beat Bottas by 0.315 seconds with a time set on their first runs as neither Mercedes driver improved on their final laps.
Verstappen did improve on his final run but ended up 0.106secs behind Bottas.
The Dutchman will start the race on the soft tyre, whereas Mercedes have gone for the favoured medium compound.
Hamilton was booed by the large contingent of Dutch fans in the grandstands as he did his television interview after the session.
"I have never felt so great with the booing," Hamilton said. "If anything, it just fuels me. So I don't really mind it.
"It was an amazing qualifying lap that last one. Amazing team work from everyone this weekend, trying to push the car forward developing constantly. It has been amazing to see everyone rallying together.
"Great having a front row lockout for our team, first time for a long time."
Verstappen, who starts the race eight points ahead of Hamilton in the championship, said: "The whole weekend we have been a bit behind and it showed again in qualifying. Not what we wanted but we are still there in third and will see what we can do."
Bottas attacks booing fans
Bottas, whose second place on the grid gives Mercedes a major tactical advantage over Red Bull for the race, condemned the fans who booed Hamilton.
"I don't think it's fair," the Finn said.
"We are here as athletes to do the best we can in the sport we love. Lewis did an amazing lap at the end and people should question themselves about this behaviour. It's not right and we don't want to hear those things."
Hamilton said: "People have a right. It's sport. People act wild when it's sport and competition. I don't take it to heart. I must be doing something right to be up front."
Verstappen added: "It's not correct, of course, but as drivers we shouldn't be disturbed by these sorts of things. It is not nice but it shouldn't influence any of us."
Hamilton dismisses gamesmanship accusations
Verstappen's team-mate Sergio Perez was fourth after failing to get around in time to start a final lap.
That happened after the Mercedes drivers in front of the Red Bulls, led by Bottas, did a very slow out lap before their final runs.
Verstappen only just managed to get around in time to complete his final lap but Perez behind him did not.
"What happened there?" he asked the team. "A bit of gamesmanship," his engineer said.
But Hamilton dismissed the claims that Mercedes were doing it on purpose.
"It's so silly," he said. "Everyone was going slow. Do you not watch everyone else? Everyone was on a slow lap. Do you think I could have been quicker and closer to Valtteri? It was no different to any other lap.
"I wasn't playing any tactics. I don't need to play tactics. I know what I'm doing in the car. I'm fast enough."
Tyre choice raises eyebrows
Red Bull's tyre choice was a surprise for Verstappen, as the medium has better pace and durability for a race stint.
The soft gives better grip off the line - it can gain a driver as much as five metres, Hamilton said - but starting third behind both Mercedes lessens Verstappen's chances of attacking Hamilton on the first lap.
But Verstappen said the team decided they wanted to run the soft tyre for his final run in second qualifying and he had no choice but to complete his lap on the soft tyres because the time he set on medium tyres earlier was too marginal and he risked getting knocked out by midfield cars on the soft.
"My lap time on the medium would have been really on the edge for a top 10 so that's why we decided to finish the lap," he said.
"We talked about it and they decided they wanted to go on the soft. In the end, it would have been safe to go through. But only by 0.03secs. It is what it is. We will find out tomorrow."
Behind the top four, Pierre Gasly impressed with fifth place for Alpha Tauri, ahead of McLaren's Lando Norris and Ferrari's Charles Leclerc.
The Alpines of Esteban Ocon and Fernando Alonso and Aston Martin's Sebastian Vettel completed the top 10.
Leclerc's team-mate Carlos Sainz will start 15th after crashing at the final corner in the second part of qualifying.
And George Russell failed to get his Williams into the second part of qualifying for the first time this season, ending up a disappointed 17th.
- Five new sports at Tokyo 2020: Everything you need to know about the events
- The fight for our attention: How can sport broadcasters make themselves the most attractive option?