There was drama in the 18th lap when champion Sebastian Vettel, who had recently pitted, was attempting to close the gap on Hamilton by negotiating his way beyond Jenson Button. The two cars clipped, though, which caused damage to the front wing of Vettel's Red Bull.
When Hamilton went in for his final pit stop, Vettel hit the front and was able to open up a nine-second lead. However, when the German pitted for the last time, Hamilton regained the initiative.
He eventually held out for the win - his fourth in Hungary - while Vettel was forced to settle for third spot behind Kimi Raikkonen.
Results in full:
1. Lewis Hamilton (Mercedes)
2. Kimi Raikkonen (Lotus)
3. Sebastian Vettel (Red Bull)
4. Mark Webber (Red Bull)
5. Fernando Alonso (Ferrari)
6. Romain Grosjean (Lotus)
7. Jenson Button (McLaren)
8. Felipe Massa (Ferrari)
9. Sergio Perez (McLaren)
10. Pastor Maldonado (Williams)
11. Nico Hulkenberg (Sauber)
12. Jean-Eric Vergne (Toro Rosso)
13. Daniel Ricciardo (Toro Rosso)
14. Giedo van der Garde (Caterham)
15. Charles Pic (Caterham)
16. Jules Bianchi (Marussia)
17. Max Chilton (Marussia)
Not classified: Paul Di Resta (Force India), Nico Rosberg (Mercedes), Valtteri Bottas (Williams), Esteban Gutierrez (Sauber), Adrian Sutil (Force India)