Hungary 1 Northern Ireland 2: Lafferty leaves it late
The British nation have never qualified for the European Championship before but late goals from Niall McGinn and Kyle Lafferty got them off to a stunning start in Budapest on Sunday.
Michael O'Neill's men failed to score in their previous four matches and appeared set to draw another blank after Corry Evans missed a first-half sitter and substitute Tamas Priskin put the hosts ahead with 15 minutes to play.
But the visitors fought back and levelled through McGinn in the 81st minute before Lafferty tapped in the crucial goal to end an eight-game winless streak.
O'Neill spoke in the build-up about genuine optimism in the Northern Irish camp and they looked confident in the early stages as the visitors crafted the game's first chance.
Lafferty showed good awareness to direct a lofted pass into the path of Jamie Ward, but his half-volley was scuffed straight to Peter Gulacsi inside the opening two minutes.
Hungary responded well and Balazs Dzsudzsak poked a first-time effort just beyond Roy Carroll's right-hand post after good work down the right from Adam Gyurcso.
But it was the away side who spurned a glorious opportunity to take the lead on the stroke of half-time.
Ward charged down a clearance on the halfway line and raced through on goal, forcing Gulacsi into a save from a tight angle, and the unmarked Evans, arriving on the edge of the area, inexplicably put the rebound over.
Attila Pinter introduced nomadic forward Priskin from the bench at the break as the home side looked to put a lacklustre first-half display behind them.
But it was Gergo Lovrencsics' arrival in the 59th minute that seemed to spark more life into the Hungary attack.
Just a couple of minutes after entering the fray, Lovrencsics found space on the edge of the area and forced Carroll into a desperate diving save to his left.
The visitors' resistance was broken in the 75th minute when Priskin headed in Dzsudzsak's cross to chalk up his 15th goal on the international stage.
O'Neill's charges were not done, though, and after a great run and squared pass from Lafferty, McGinn was left with the simplest of finishes.
Lafferty was integral again seven minutes later and, after Hungary failed to deal with a cross from the right, the former Rangers man squeezed the ball over the line to secure an unlikely win.
Northern Ireland welcome the Faroe Islands next month as they bid for their first back-to-back triumphs since 2009, while Hungary face a tricky trip to neighbours Romania.