They promised a night to remember at Windsor Park, and just as it appeared destined to be unforgettable for all the wrong reasons, Kyle Lafferty struck an injury-time lifesaver to put Northern Ireland on the brink of qualification for Euro 2016.
Down to 10 men and with three players facing suspension in next month's qualifier against Greece, Michael McGovern's mistake for Richard Guzmics's 75th-minute goal looked bound to haunt the Hamilton Academical goalkeeper for the rest of his days.
But four minutes into five minutes of stoppage time, the talismanic figure of Lafferty hauled Michael O'Neill's team level by scoring from close range after goalkeeper Gabor Kiraly had saved Niall McGinn's initial effort.
That made it seven goals in eight games in qualification for the Norwich City forward, who will miss October's encounter with Greece along with Conor McLaughlin and Chris Baird, whose dismissal for two yellow cards by Turkish referee Cuneyt Cekir bewildered the whole Windsor Park crowd.
The 3-1 victory against the Faroe Islands in Torshavn on Friday had ensured O'Neill's team would face Hungary with a clear objective - win, and three decades of waiting to compete at a major tournament would be over. Although a noisy and expectant crowd inside a half-built Windsor Park turned up with the sole intention of celebrating qualification for France, Hungary, set out to frustrate the home side and turn down the volume in the stands.
The £35 million redevelopment of this stadium will ultimately drag the ramshackle old ground into the 21st century, but the timing of the building work denied Northern Ireland the same kind of raucous cauldron which inspired Lawrie Sanchez's team to a 1-0 victory against England here, 10 years ago to the day, in 2005.
The nervous atmosphere and high stakes inevitably led to a cagey first half, with Balazs Dzsudzsak going close with the first chance of the game on four minutes when the Hungarian winger shot narrowly wide of McGovern's left-hand post.
Northern Ireland's progression to top spot in Group F ahead of this game imbued O'Neill's team with the confidence to be patient against organised opponents, however, and the home side increased the pressure on Hungary with Oliver Norwood and Chris Brunt running the midfield and winger Stuart Dallas dominating the left flank.
But chances were thin on the ground and Kiraly spent the first half doing little more than providing vocal encouragement for his defenders. Kiraly was forced to punch clear a Brunt free-kick and watch a Dallas shot blocked by full-back Leandro, but it was otherwise an opening 45 minutes of little note.
Fighting for qualification to a major tournament has become a forgotten art in Northern Ireland, so the inability of O'Neill's players to make a first-half breakthrough was understandable.
Six of the starting line-up were not even born when Sammy McIlroy, Pat Jennings and Norman Whiteside led Billy Bingham's team to Mexico in 1986 and, being so close to emulating the iconic figures of the past, clearing the final hurdle to France was akin to a rookie walking up the 18th fairway with the Claret Jug almost within his grasp.
Northern Ireland were suffering from the yips as the prize loomed into view, with Jonny Evans guilty of a poor header from Norwood's corner on 54 minutes. It was a clear chance for the West Bromwich Albion defender, but he mistimed his jump and directed his effort high over the crossbar rather than heading the ball downwards.
Norwood, a bundle of energy in midfield, appeared Northern Ireland's best hope of a breakthrough, but he was restricted to efforts from distance and a 30-yard free-kick which at least forced Kiraly into a save on 57 minutes.
Although Zoltan Gera shot wide from 25 yards on 67 minutes, Hungary were getting closer and McGovern was forced to tip a Zsolt Kalmar free-kick over the bar six minutes later.
Northern Ireland were rocking and Guzmics delivered a hammer blow on 75 minutes when, after McGovern spilt Dzsudzsak's free-kick, the Wisla Krakow defender tapped in from two yards.
It looked poised to be the ultimate heartbreaker, but Lafferty's goal in the dying seconds left Northern Ireland needing two points from their remaining two games to qualify. (© Daily Telegraph, London)