The fight for pole came down the final seconds of qualifying, with Hamilton taking top spot with his final lap only for Bottas to snatch the place back from the Briton in reply.
The Finn’s best time of 1 minute 25.525 seconds was a quarter-second quicker the Briton and more than two seconds quicker than the track record, which was previously set by Japan’s Takuma Sato in 2004.
“It’s such a nice feeling when you get it on the last lap with the last chance,” Bottas said. “it’s just what I needed.”
Hamilton, who leads the title race by 44 points, had to settle for second, from where he’ll try to equal Michael Schumacher’s record 91 victories.
“There’s a lot to play for tomorrow, so I need to get by head down.”
Max Verstappen threatened to take the first non-Mercedes pole of the season when he emerged quickest of all halfway through the top-10 shootout, but the Red Bull Racing driver’s challenge faded to leave him 0.3 seconds shy of the benchmark.
“I think we are getting closer towards Mercedes, which I think is very positive,” he said. “I was expecting a little bit more, but… overall I can still be happy.”
Charles Leclerc will share the second row with Verstappen after qualifying a sensational fourth place for Ferrari.
The Monegasque relegated Thai driver Alex Albon to fifth in the second Red Bull Racing car alongside Renault’s Daniel Ricciardo on the third row of the grid.
Esteban Ocon in the second Renault beat McLaren’s Lando Norris to seventh and eighth.
Sergio Perez was 1.4 second off the pace for Racing Point in ninth ahead of McLaren’s Carlos Sainz in 10th.
Sebastian Vettel fell an inexplicable 0.4s short of a top-10 berth for Ferrari, qualifying 11th for his home race.
AlphaTauri’s Pierre Gasly was less than 0.04s adrift of the German In 12th, leading 13th placed teammate Daniil Kvyat.
Alfa Romeo’s Antonio Giovinazzi converted his first Q2 qualification into 14th place, pushing Haas driver Kevin Magnussen down to 15th on the grid.
Romain Grosjean qualified 16th in the second Haas car after having his fastest lap deleted for running off the track at turn four.
Williams teammates George Russell and Nicholas Latifi will start from 17th and 18th on the ninth row of the grid ahead of Alfa Romeo’s Kimi Raikkonen.
Nico Hulkenberg was recalled by Racing Point for the third time this season, this weekend to substitute for Lance Stroll, who withdrew from the grand prix less than two hours before qualifying with illness.
The German qualified an admirable half-second outside the top 15 with barely 18 minutes of track time.
Hulkenberg had previously deputised Sergio Perez at the British and 70th Anniversary grands prix in August after the Mexican driver contracted COVID-19.