Kimi Raikkonen [ Images ], driving the only Ferrari [ Images ] in the race after Brazilian team mate Felipe Massa [ Images ] suffered a serious head injury in qualifying, was second but under investigation by stewards for colliding with Red Bull's Sebastian Vettel [ Images ] at the start.
Brawn GP's Button had a frustrating afternoon in the Hungarian heat, struggling to get performance out of the car's tyres, and finished seventh after starting eighth.
His unhappiness was only relieved by the retirement of Vettel, his previous closest rival, and seeing the top two places filled by drivers whose title dreams had long disappeared.
Hamilton's victory, 11.5 seconds ahead of 2007 champion Raikkonen, was the 24-year-old's first since China last October, and 10th of his career. It was his Mercedes-powered team's first podium finish of the year.
"Great job guys," said Hamilton after he took the chequered flag. "This car is so nice to drive. Fantastic. You guys have worked so hard and I'm so glad we could do it."
Martin Whitmarsh joined the champagne-spraying Hamilton on the podium for his first win as McLaren team boss while the driver's pop singer girlfriend Nicole Scherzinger [ Images ] shed a tear of happiness.
In a footnote for statisticians, it was also the first success for a car equipped with the new KERS energy recovery system.
"It's an incredible feeling to be back here after what seems like such a long time away," said Hamilton. "We've caught up quite a bit but we never really thought we had the pace to win. To get a win, it's amazing."
Germany's [ Images ] Nico Rosberg [ Images ] was fourth for Williams ahead of McLaren's Heikki Kovalainen [ Images ], last year's surprise winner in Budapest, and Toyota's [ Images ] Timo Glock [ Images ].
Italian Jarno Trulli [ Images ] took the final point for Toyota.
Renault's [ Images ] double world champion Fernando Alonso [ Images ] had started on pole position but the Spaniard lasted only 17 laps before retiring after earlier having to limp back to the pits on three wheels.
His compatriot Jaime Alguersuari, driving a Toro Rosso, became Formula One's youngest ever starter at the age of 19 years and 125 days.
The teenager finished 15th, lapped but ahead of Swiss rookie team mate Sebastien Buemi [ Images ].
Ferrari paid tribute to Massa, in intensive care in a Budapest hospital after emergency surgery on Saturday, before the race with a pit board declaring "Forza Felipe, Siamo Con Te" (Come on Felipe, we are with you).
"Maybe I can speak for all of us. Today was a sad day given what happened to Felipe," said Hamilton. "We miss him, wish him well and a speedy recovery."