Italy are the third nation to qualify for the Nations League finals
Marco Rossi's Hungary side had gone into the fixture at the Puskas Arena only needing a draw to reach the last four of the competition.
However, a defensive lapse allowed Giacomo Raspadori to roll the ball into an empty net and put Italy ahead.
Federico Dimarco sealed victory for the European champions after the break when he tapped in Bryan Cristante's cross.
The result means Italy finish top of Group A3 with 11 points from six games, one point above Hungary, with Germany third and relegated England in fourth.
It also marks Italy's first win in Budapest since 1996 and while goalkeeper Gianluigi Donnarumma was called upon to make several excellent late saves, Roberto Mancini's side were worthy winners.
Italy, who failed to qualify for the World Cup in Qatar, join Croatia and the Netherlands in next June's finals tournament, with Spain and Portugal set to meet in Braga on Tuesday for the last available spot.
-- Courtesy of BBC Sport