Northern Ireland's Euro 2020 qualifying hopes survived a scare as substitute Josh Magennis scored twice in four minutes to snatch a 2-1 win in Estonia.
Konstantin Vassiljev's 25th-minute free-kick looked like being the difference between the two sides as Northern Ireland's struggles in front of goal away from home continued, but Magennis turned it around in Tallinn in the final 15 minutes.
Both goals came via the slightest of touches - the first on Conor Washington's shot and the second enough to divert Jordan Jones' cross into the net - but both could have a major impact for Northern Ireland.
Defeat here would have left their Euro 2020 hopes hanging by a thread with home and away games against Holland and Germany to come later in the year, but victory keeps them top of the group with a maximum haul of nine points ahead of Tuesday's trip to Belarus.
It was a dramatic end to a game which threatened to end in frustration, with Michael O'Neill's men showing for too long why they came into the night without an away goal in seven outings.
Though they bossed possession early on, chances were few and far between and once Vassiljev - their tormentor in a World Cup qualifier eight years ago - had punished a mistake by Stuart Dallas with a low, bending free-kick around the wall, Northern Ireland looked panicked as they gave the ball away.
Estonia had the ball in the net again six minutes before the break but it was ruled out by referee Fabio Verissimo, perhaps generously as goalkeeper Bailey Peacock-Farrell appeared to run into Rauno Sappinen before Madis Vihmann headed in.
At the other end Gavin Whyte, making his first competitive start, sent in a fine cross but Liam Boyce could not get the direction on his glancing header and Estonia ended the half on top, with Vassiljev scuffing a shot wide when left virtually unmarked inside the area.
O'Neill sent on Washington for Boyce at half-time to try to find a spark, but Northern Ireland lacked composure and were almost punished as Vassiljev sent a dipping shot on to the crossbar.
Northern Ireland soon began to stir and Dallas cut in from the left and picked out George Saville, who poked the ball goalwards to bring a first save of the night from Sergei Lepmets.
Peacock-Farrell had to save low down from Vlasiy Sinyavskiy as Estonia looked to hit their opponents on the counter-attack, but the flow of traffic was now firmly in Northern Ireland's favour.
Lepmets fluffed a clearance to gift the ball to Jones, but scrambled back into position before the Rangers winger floated a cross over.
But Northern Ireland got their equaliser in the 77th minute when Washington cut in from the left side and was able to run straight to the centre of the goal before clipping a shot over Lepmets, which diverted off Magennis to find the net.
And three minutes later Northern Ireland were ahead as Magennis got a deft touch to Jones' cross for the ball to trickle over the line.
The celebrations were almost cut short by Artjom Dmitrijev, but Peacock-Farrell was at full stretch to push his powerful drive away.
There was another late scare as Dimitrijev headed just wide while Jones was close to adding a third at the other end, but Northern Ireland had already done enough.