Midfielder Kim Källström struck first, heading home the first goal off of a sailing cross delivered by team captain Henrik Larsson in the 55th minute.
It was a much needed spark for Sweden, which had been unable to find the goal in the opening half, prompting the 28,000 fans at Råsunda stadium outside of Stockholm to boo the squad as they headed off the field at the break.
After a disappointing 0-0 draw in Albania on Saturday, Sweden was in desperate need of a victory at home in order to keep its World Cup hopes alive.
Larsson again worked his magic to add to Sweden’s lead in the 64th minute when he sent a fine pass to midfielder Samuel Holmén, a new addition to the starting lineup, who proved his worth by netting Sweden’s second goal of the evening.
Hungary managed to slip in a late goal in extra time just before the final whistle when a ball bounced off the chest of substitute Gergely Rudolf.