McLaren's Lewis Hamilton won a thrilling German Grand Prix with a feisty drive at a chilly Nurburgring to move third in the championship.

Hamilton jumped Mark Webber's Red Bull at the start for the lead, lost and regained it before beating Ferrari's Fernando Alonso and Webber to the line.

An error-strewn drive saw Red Bull's Sebastian Vettel finish fourth but his championship lead remains 77 points.

An aggressive qualifying lap had earned Hamilton second on the grid behind Webber and the 26-year-old delivered more of the same when it counted most.

A second victory of the season - and his 16th career victory - leaves Hamilton 82 points behind Vettel with nine races left to go.

Hamilton celebrated on his pit-to-car radio: "Great job guys, great job. Keep pushing, these are the results we can get, it's amazing."

The 2008 world champion jumped pole-sitter Webber at the start to take the lead and although the Australian passed him a few laps later, Hamilton used the Red Bull's slip stream to re-take the lead.

The first round of stops saw Webber make a more decisive move as he pitted first on lap 14 and while Hamilton, Alonso and Vettel jostled for position coming out of the pit lane two laps later Webber sailed supremely into the lead.

An intense battle followed with less than two seconds covering Webber, Hamilton and Alonso. But Vettel, who had spun on the damp track, fell away from the leading pack.

The second stop for new soft tyres saw another dramatic switch of position with Webber again pitting first followed on the next two laps by Hamilton and Alonso.

Hamilton moved into the lead, slightly nudging Webber out of the way as the Australian tried to defend his lead, but Alonso moved in front on his way out of the pit lane.

The Spaniard's lead did not last long as Hamilton drove around the Ferrari on the outside to move back into first position.

There was every chance the trio of closely matched drivers could have swapped positions in an obligatory stop for hard tyres inside the final 10 laps.

But Hamilton, who came in first, held on to take his first victory since April's Chinese Grand Prix ahead of Alonso and Webber.

German Grand Prix result:
1. Lewis Hamilton (GB) McLaren-Mercedes
2. Fernando Alonso (Spa) Ferrari
3. Mark Webber (Aus) Red Bull-Renault
4. Sebastian Vettel (Ger) Red Bull-Renault
5. Felipe Massa (Brz) Ferrari
6. Adrian Sutil (Ger) Force India-Mercedes
7. Nico Rosberg (Ger) Mercedes GP
8. Michael Schumacher (Ger) Mercedes GP
9. Kamui Kobayashi (Jpn) Sauber
10. Vitaly Petrov (Rus) Renault

Championship standings:
1. Sebastian Vettel (Ger) Red Bull-Renault 216 pts
2. Mark Webber (Aus) Red Bull-Renault 139
3. Lewis Hamilton (GB) McLaren-Mercedes 134
4. Fernando Alonso (Spa) Ferrari 130
5. Jenson Button (GB) McLaren-Mercedes 109
6. Felipe Massa (Brz) Ferrari 62
7. Nico Rosberg (Ger) Mercedes GP 46
8. Nick Heidfeld (Ger) Renault 34
9. Vitaly Petrov (Rus) Renault 32
10. Michael Schumacher (Ger) Mercedes GP 32

Constructors' championship:
1. Red Bull-Renault 355 pts
2. McLaren-Mercedes 243
3. Ferrari 192
4. Mercedes GP 78
5. Renault 66

BBC Sport