Race: Sunday 1300 BST. Live on BBC Radio 5 Live and BBC Sport website
Hamilton (right) took his third pole of 2008 with team-mate Kovalainen third
McLaren's Lewis Hamilton left it late to produce a superb lap and qualify on pole for Sunday's German Grand Prix.
The Briton eclipsed Ferrari's Felipe Massa on his final run, clocking one minute, 15.666 seconds at Hockenheim.
Hamilton's McLaren team-mate Heikki Kovalainen was third behind Massa and lines up with Toyota's Jarno Trulli.
Renault's double world champion Fernando Alonso and Ferrari's defending champion Kimi Raikkonen share an intriguing third row.
Robert Kubica battled his way through a difficult weekend to take seventh place on the grid for BMW Sauber ahead of Red Bull's Mark Webber.
Sebastian Vettel was the only one of five German drivers in the field to finish in the top 10, taking ninth place for Toro Rosso ahead of David Coulthard in the second Red Bull.
Hamilton powered himself into the best position for his attempt to pull clear at the top of the drivers' standings on Sunday.
The Englishman is locked in a three-way tie with Massa and Raikkonen on 48 points.
And his third pole of the season gives him an opportunity to dictate the race at Hockenheim, although Hamilton is still aware of the threat posed by his rivals.
"It's very close as you can see," Hamilton, 23, said. "I was surprised to see how close it is between all the teams, with Vettel, Alonso and Webber all there.
"But between us and Ferrari it's just a 10th [of a second] here or there and we'll keep pushing and moving forward.
"It's been a good day but this is not where you win points and me and Heikki will do the best job we can to make sure we get a one-two on Sunday."
Hamilton and Kovalainen could have wrapped up the front row in qualifying but Kovalainen, who was pressing hard, ran wide at the last corner to lose vital time.
Ferrari will be relieved at that because Massa was the only real threat to the McLarens as Raikkonen struggled to get to grips with his Ferrari's handling.
The Finn, who has not topped the podium in five races, did his best to keep his car on the racing line but qualified in a distant sixth - more than a second adrift of Hamilton.
"All weekend long, we have been struggling a bit to find a good set-up for the car," said Raikkonen
"Clearly sixth place is not satisfying and tomorrow we won't be in for an easy time, but it's definitely not the end of the world."
However, his team-mate Massa is still predicting a close race on Sunday between both sets of McLarens and Ferraris.
"It will be tough and very tight," insisted the Brazilian, who was in fluid form for Ferrari around Hockenheim.
"It will be a big competition between all four cars and we need to do everything right in the race."
Both Trulli and Alonso were realistic about their chances of converting excellent qualifying runs into podium places.
Alonso stated: "Race pace is always one of our biggest problems but hopefully we can keep fifth place until the end."
Kubica, who is two points behind the leaders in the drivers' standings, will certainly want to finish higher up after being hampered by driveshaft and tyre pressure problems.
But while the Pole starts in seventh, his team-mate Nick Heidfeld disappointed BMW fans on home soil by qualifying in 12th.
Nico Rosberg starts 13th in his Williams, followed by Honda's Jenson Button.
The Englishman's team-mate Rubens Barrichello looks unlikely to repeat his British Grand Prix feat and earn a podium spot, after qualifying down in 18th.
However, the Brazilian - and Hamilton - profited from the wet conditions at Silverstone and more rain is forecast in Hockenheim on Sunday.
Qualifying results for the German Grand Prix:
1. Lewis Hamilton (GB) McLaren-Mercedes
2. Felipe Massa (Brz) Ferrari
3. Heikki Kovalainen (Fin) McLaren-Mercedes
4. Jarno Trulli (Ita) Toyota
5. Fernando Alonso (Spa) Renault
6. Kimi Raikkonen (Fin) Ferrari
7. Robert Kubica (Pol) BMW Sauber
8. Mark Webber (Aus) RedBull - Renault
9. Sebastian Vettel (Ger) Toro Rosso - Ferrari
10. David Coulthard (GB) RedBull - Renault
11. Timo Glock (Ger) Toyota
12. Nick Heidfeld (Ger) BMW Sauber
13. Nico Rosberg (Ger) Williams - Toyota
14. Jenson Button (GB) Honda
15. Sebastien Bourdais (Fra) Toro Rosso - Ferrari
16. Kazuki Nakajima (Jpn) Williams - Toyota
17. Nelson Piquet (Brz) Renault
18. Rubens Barrichello (Brz) Honda
19. Adrian Sutil (Ger) Force India - Ferrari
20. Giancarlo Fisichella (Ita) Force India - Ferrari