It was the Briton's second win of the year and 16th of his career and not only revitalised McLaren, but also proved once again that runaway leader Sebastian Vettel and the Red Bull team are not invincible.
The 26-year-old, who started from second on the grid at the Nürburgring, took the lead from the start and delivered a well-judged race and some flamboyant passing moves, supported by excellent strategy, to resist strong challenges from his rivals.
"That was one of the best races that I have ever done," said a delighted Hamilton, after winning for the first time since the Chinese Grand Prix in April. "We didn't expect to come here and be so fast and really I just could not be feeling any better.
"It was just great and we have to keep pushing. These are the results that we can get - the car was really nice to drive. A fantastic job and fantastic win."
The 2008 champion controlled the race almost entirely, but had to fight at times to retain his advantage as he came home 3.9 seconds ahead of second placed Spaniard Fernando Alonso of Ferrari.
Two-time champion Alonso, who won the British Grand Prix two weeks ago, finished a strong second ahead of third-placed Australian Mark Webber, the pole-sitter, of Red Bull and his team-mate defending champion Vettel, in fourth, after a brilliant final pit stop saw him move up from fifth in the pit lane.
Vettel remains out in front of the title race by 77 points with 216 ahead of Webber on 139 and Hamilton, now third, on 134. Alonso is fourth on 130.
In the constructors' championship, Red Bull lead with 355 points ahead of McLaren on 243 while Ferrari are third on 192.
McLaren team chief Martin Whitmarsh was delighted with Hamilton's performance, despite seeing Jenson Button, the 2009 champion, forced to retire with hydraulics problems.
"What a fantastic race," he said. "You had three teams, three drivers, really battling it out. Lewis just drove a fantastic race. We were very nervous all the way through to be honest."
Alonso said: "I am extremely happy with today's result. We had a weekend that probably was not the easiest one. We struggled a bit on Friday, in qualifying we were fourth, half a second from pole so no doubts that we struggled a bit more with the weekend.
"But even with the difficulties we are second and fighting for victory, so this is a fantastic achievement. Second in Valencia, first at Silverstone and second here."
Webber, beaten from pole for the second successive race, said: "We weren't quick enough. I did everything I could. I'm happy with the way I drove, but these guys had a bit of an extra margin, especially in the back part of the stints. That made us a little bit exposed on strategy."
It was runaway leader Vettel's worst finish of a dominant season and signaled that, at last, the Red Bull team may have a battle on their hands in
the second half of the year.
"We have to accept that today other people were quicker than us, and sure, I'm not happy, I'm not satisfied," said Vettel. "I didn't feel too good all weekend, I never got to the pace Mark (Webber) had in his car."
Felipe Massa came home fifth for Ferrari ahead of Germans Adrian Sutil of Force India, Nico Rosberg of Mercedes and his team-mate, seven-time champion Michael Schumacher.
Japanese Kamui Kobayashi was ninth for Sauber, after starting 17th, and Russian Vitaly Petrov 10th for Renault.