Bottas, who won last time out in Russia, saw off his Mercedes team-mate by an impressive 0.256 seconds with his final lap of the afternoon to take the spoils at the Nurburgring.
Red Bull's Max Verstappen will line up from third on the grid ahead of Ferrari's Charles Leclerc. Alexander Albon took fifth place in the other Red Bull.
Following Friday's washout, the drivers had just one hour of practice at a venue the sport has not visited since 2013.
For a period it looked as though Verstappen could secure the first non-Mercedes pole of the season, but the Dutchman eventually had to settle for third, albeit just four hundredths behind Hamilton.
Bottas is 44 points adrift of Hamilton in the standings, but his pole lap here will give him hope that he could yet provide his team-mate with a championship fight over the concluding seven rounds.
"It is such a nice feeling when you do it with you last lap," said Bottas after taking the 14th pole of his career. "Of course I believe I can win tomorrow and that is the only goal."
Hamilton, who finished third in Sochi a fortnight ago after he was dealt a 10-second penalty for a pre-race infringement, added: "Valtteri was two tenths ahead today so he did a great job and congrats to him. It is an amazing circuit, so it is great to be back here."
Nico Hulkenberg was handed his third substitute appearance of the season after he received a late call-up from Racing Point to deputise for the unwell Lance Stroll.
The 33-year-old German, who filled in for Sergio Perez at the British and 70th Anniversary Grands Prix at Silverstone after the Mexican contracted coronavirus, finished last of the 20 runners.
One spot ahead of him on the grid will be veteran Kimi Raikkonen, 40, who will start his 323rd F1 race on Sunday to surpass Rubens Barrichello as the most-capped driver in history.
Sebastian Vettel was a disappointing 11th, while British driver Lando Norris finished eighth for McLaren, with compatriot George Russell 17th in his Williams.