Linfield are through to the next round of the Champions League following a stunning defeat of The New Saints at Windsor Park.
The Blues trailed the Welsh champions by a single goal from last week's first leg in Oswestry, and went into the game nothing less than a positive result inside 90 minutes would prevent a drop into the Europa Conference League.
David Healy's side created a couple of decent opportunities in the scoreless first half when Daniel Finlayson produced a good stop from Connor Roberts before, close to the break, Robbie McDaid ran onto a Chris Shields through ball to send a diving header straight at the visiting keeper.
TNS almost doubled their aggregate lead early in the second half through Declan McManus who connected with a dangerous cross but was thwarted by Chris Johns while, with around a quarter-of-an-hour remaining, Matthew Clarke made a timely intervention to deny McManus.
With time running out for Linfield, substitute Ethan Devine almost levelled in the 90th minute only to smash a header against the crossbar from Kirk Millar's cross.
But that wasn't Linfield's last chance. They grabbed a dramatic equaliser four minutes into added time through skipper Jamie Mulgrew who, some 25 yards from goal, smashed the ball home to give Roberts no chance and force extra-time.
Then, in the 94th minute, Devine - so often the scorer of crucial late goals last season - struck again to ultimately secure the win for Linfield from close range after Chris McKee had found him with a precision pass.
Linfield now go through to the Second Qualifying Round against Norwegian opponents Bodo/Glimt. The Blues host the first leg next Tuesday (19th) before travelling to Scandinavia for the return a week later.
Linfield: Johns, Roscoe, Shields, Millar, McClean, Cooper, McDaid, Hall, M. Clarke, Finlayson, Fallon subs Walsh (not used), Newberry (not used), Stewart (replaced McClean 67), McKee (replaced Finlayson 67), Devine (replaced McDaid 78), Mulgrew (replaced Hall 78), Pepper (replaced Millar 100), Quinn (not used), A. Clarke (not used), Palmer (replaced Fallon 100), Archer (not used)
The New Saints: Roberts, Marriott, K. Davies, Astles, Routledge, Brobbel, McManus, Redmond, Williams, Smith, D. Davies subs Atherton (not used), Pask (replaced D. Davies 83), J. Daniels (replaced Smith 105), Cieslewicz (replaced Williams 78), Hudson (replaced K. Davies 111), Clark (replaced Redmond 68), Canavan (not used), Kirkman (not used), Lock (not used), Warder (not used), Cornish (not used)