A first-half penalty by Gylfi Sigurdsson put little Iceland on course for a fairytale win. But the European Championship newcomers succumbed to waves of late Hungarian pressure.
With 88 minutes gone, substitute Nemanja Nikolic sent a low ball into the area and in the thick of a goalmouth scramble, Savarsson touched the ball into his own net.
Prior to the tournament both teams viewed this Marseille tie as their best opportunity to get a win. But unfancied Hungary’s shock 2-0 victory against Austria on Tuesday meant a slot in the last-16 beckoned if they could beat the Scandinavians.
Hungary had more of the ball in the first-half, but, more used to playing a counterattacking game, they failed to craft clearcut openings against a physical Iceland defense.
Their midfield trio of Laszlo Kleinheisler, Balazs Dzsudzsak and Zoltan Stieber probed industriously. But the nearest they came to hitting the target in the first half was a Kleinheisler effort that raked across the goalmouth on 33 minutes.
In contrast, Iceland attacks carried more direct menace, with their best chance falling to Johann Gudmundsson on the half hour.
Having shouldered right-back Tamas Kadar off the ball, he found himself one-on-one against Hungary goalkeeper Gabor Kiraly but angled a weak shot straight at the 40-year-old, the oldest player ever to play at a European Championship final.
Approaching half-time Kiraly took centre-stage in a horror show he will want to forget.
Six minutes before the break he fumbled a corner from Johann Gudmundsson, then tripped Ragnar Sigurdsson while grappling to recover the ball.
In the scramble that ensued referee Sergei Karasev pointed to the spot for a kick by Kadar on Gunnarsson.
He dived the wrong way for the penalty as Sigurdsson fired smartly to the left to give the Scandinavians the lead. Kiraly kicked the ball away in disgust.
After the break the Magyars resumed their pressure with Kleinheisler blasting over over twice in five minutes.
But it was Iceland who could have extended their lead on the hour, Sigthorsson heading wide from point-blank range after a pinpoint cross by Sigurdsson.
The goal-shy Magyars-who only scored 11 goals in 10 qualifying games-toiled anxiously for the leveller with Dzsudzsak twice sending free-kicks straight at Hannes Halldorsson.
As Hungary anxiously sought an equaliser Bernd Storck sent on Nikolic as an extra striker but they appeared to lack the final breakthrough touch.
Nikolics cross finally secured the equaliser to break Icelandic hearts.
Iceland, who nearly stole a winner with the final kick, a snapshot by subsitute former Chelsea and Barcelona forward Eidur Gudjohnsen, face Austria on Wednesday in their final group game.
The Nordic minnows need a win to seal a berth in the knockout stages. Hungary can progress by avoiding defeat against Portugal in Lyon the same day.