Local favourite Nico Rosberg will start on pole for Sunday's German Grand Prix after edging out his title rival Lewis Hamilton.

Rosberg, six points behind Hamilton in the championship, had been fastest in all three practice sessions at Hockenheim, and he made it count where it matters to secure his second pole in as many grands prix.

Daniel Ricciardo qualified third for Red Bull while his team-mate Max Verstappen will start from fourth.

Hamilton, a winner in five of the last six races to leapfrog Rosberg at the top of the driver standings, was forced to see the stewards on Saturday morning when he was adjudged to have blocked the Haas of Romain Grosjean following an unsafe release by his Mercedes team in final practice.

It was feared that the Briton, whose defence of his third title has been plagued by bad luck, could be hit with a reprimand for the error, which would have resulted in an automatic 10-place grid drop.

But following a brief investigation, Hamilton escaped any punishment although his team were fined €10,000 for their part in the incident.

The verdict from the stewards enabled Hamilton to take on Rosberg in a straight fight for pole, and it was the latter who prevailed to the delight of his home crowd.

Hamilton had appeared on course to improve on his final timed run, but made a mistake at the hairpin. And his error paved the way for Rosberg to beat him to the top slot on the grid with one of his best qualifying displays of the season. 

With the Red Bull drivers locking out the second row behind Mercedes, Kimi Raikkonen and Sebastian Vettel qualified fifth and sixth for Ferrari.

Jolyon Palmer vowed to bounce back from the spin which cost him his first points in the sport last weekend in Hungary.

And the British rookie, whose future in Formula One beyond his debut season remains in doubt, turned in a strong performance to squeeze into Q2 at the expense of his Renault team-mate Kevin Magnussen.

Palmer ultimately qualified 16th, but will start one place higher on the grid after Grosjean was handed a five-place penalty for an unscheduled gearbox change.

Jenson Button, given the all-clear to race after he was taken to hospital with an eye complaint on Friday night, will line up in 12th on the grid, while his McLaren team-mate Fernando Alonso could manage only 14th.

It is a display which is likely to have pleased McLaren chairman Ron Dennis who arrived in the paddock on Saturday.