Sweden had won seven of the previous eight meetings and only lost twice in the last 13 head-to-head clashes going back to 1992, yet they were under pressure right from the off, and it was all coming from Rolland Sallai.
He had three efforts in the opening six minutes - his first was blocked, the second forced a great stop from Robin Olsen and, from the resulting corner, his third flew over the crossbar.
Dominik Szoboszlai tested Olsen from range just before the 15-minute mark, as the visitors struggled to get forward in the absence of target men Alexander Isak and Viktor Gyokeres.
That was until just after half an hour when a ball forward was chested down by Anthony Elanga, who rifled an effort against the underside of the bar and away from danger.
That signalled the best period of the half for the Swedes, as Elanga flashed another shot narrowly wide, yet the Blagult failed to have a shot on goal before the first 45 minutes were up.
However, it took only three second half minutes for Sweden to not only put that right, but take the lead in Budapest.
Hjalmar Ekdal squared to Benjamin Nygren, who created himself some shooting space inside the area and curled a strike into the top left corner.
Jon Dahl Tomasson's men continued to pepper the Hungarian goal, with Elanga and Yasin Ayari having the better of the chances, though Sallai continued to threaten at the other end.
With 65 minutes on the clock, Sweden were given a gift from Hungary goalkeeper Denes Dibusz - out of his goal, he played the ball straight to Ayari, who guided it into the empty net from just inside the box.
Late on, Dibusz restored a little personal pride by denying Elanga a Swedish third, while Olsen preserved his clean sheet by frustrating Sallai one final time to wrap up the 2-0 win.
Sweden will face Algeria at home on Tuesday, by which time they will have lost just once in over a year.
Follow the June international friendlies on Flashscore.