Chris Casement’s injury-time winner saw Linfield maintain their nine-point lead at the top of the table as the visitors saw off a superb Newry City AFC.
The defender’s dramatic moment left Linfield with a vital victory in the Danske Bank Premiership title race.
The table-toppers should have gone in front with two chances in as many minutes shortly after the half-hour mark.
The first arrived when Niall Quinn curled in a tantalising ball from a corner on the right-hand side and, with Newry keeper Andy Coleman coming out to claim but getting nowhere near it, Mark Stafford headed goalwards only to see his effort come back off the crossbar.
As Linfield forced a succession of corners, they had another opportunity to break the deadlock when Daniel Kearns dinked the ball back into the danger zone after another Quinn corner hadn’t been cleared.
Stafford directed the ball into the six-yard box towards Ryan McGivern, but he could only hook over the bar from close range.
Linfield thought they had gone in front four minutes after the restart when they had the ball in the net only to see it ruled out for offside.
Following a bright opening to the second period, Quinn’s super cross from the right was glanced past Coleman from eight yards out by Andy Waterworth - but as he celebrated, the referee’s assistant’s flag on the far side had already gone up.
There was more controversy four minutes after the hour when Waterworth went down under Dale Montgomery’s challenge on the edge of the box.
It looked like the Newry man had got the ball but referee Lee Tavinder blew for the foul and appeared to point to the penalty spot, only to change his mind on the advice of his assistant.
A change was required for Linfield and it came midway through the second period with Jordan Stewart and Michael O’Connor introduced for Kearns and Marek Cervenka.
But it was McGivern who thought he had scored his first Linfield goal on 71 minutes when Quinn’s cross was only cleared as far as the defender 12 yards out, but his volley bounced inches wide of the right-hand post.
In a rare foray forward in the second half, Newry were almost in 13 minutes from time when Karl Moody played a clever ball into Declan Carville, but Gareth Deane came rushing off his line to clear.
Then came the killer goal two minutes into stoppage time when Casement rose highest in the penalty area to nod home Quinn’s cross.
Newry City AFC: Coleman, King, M.Hughes, Montgomery, Boyle, McCann, Carville, S.Hughes, Moody (Healy, 82), McCabe, Lavery
Subs (not used): Maguire, Walker, Teggart, Pender, Durnin, McCullough.
Linfield: Deane, Casement, Stafford, McGivern, Millar, Quinn, Robinson, McClean, Kearns (Stewart, 64), Waterworth, Cervenka (O’Connor, 64).
Subs (not used): C.Mitchell, Moller Nielsen, Forde, Clarke, A.Mitchell.
Referee: Lee Tavinder.