Vettel was runner-up, 17.1 seconds behind, and surviving a late collision with Hamilton’s team mate Valtteri Bottas who also banged bodywork with Red Bull’s Australian Daniel Ricciardo.
Ferrari, mourning the death of former chairman Sergio Marchionne, had Kimi Raikkonen finish third to complete a podium of champions on a dry and sweltering afternoon at the Hungaroring outside Budapest.
The victory was Hamilton’s record sixth in Hungary, fifth of the season and 67th of his career.
After 12 races, Hamilton has 213 points to Vettel’s 189.
Tyre strategies were also crucial at a relatively slow and twisty circuit where overtaking is always difficult, with track temperatures hovering around 50 degrees Celsius.
Vettel started on the softs and went for a longer first stint than Mercedes, worried by Ferrari's quick getaways, who opted for ultrasofts that were quicker at the start but faded more rapidly.
Mercedes’ Lewis Hamilton celebrates on the podium after winning the race. (Photo: Reuters)
Lining up in fourth place on the grid, Vettel grabbed third from Raikkonen immediately but could not find a way past Bottas who slotted in behind Hamilton as a defence against the red threat.
Raikkonen, without water during the race after Ferrari forgot to connect the bottle, made two stops and agreed third - his fifth successive podium finish - was the best he could have hoped for in the circumstances.
Ricciardo, starting 12th, finished fourth but his Dutch team mate Max Verstappen retired early on with a Renault engine failure that infuriated both driver and team boss Christian Horner.
Bottas ended up fifth, and was called to see stewards about the collisions, with French driver Pierre Gasly sixth for Toro Rosso.
Kevin Magnussen was a lapped seventh for Haas, lifting the U.S.-owned team to fifth and ahead of Force India, with double world champion Fernando Alonso eighth for McLaren on his 37th birthday.
Carlos Sainz took two points for Renault in ninth and Romain Grosjean made sure of another for Haas.