Dungannon needed extra time to get past Limavady 2-1 in a tight second round tie.
An own-goal in the 119th minute saw the BetMcLean League Cup holders avoid an upset against the Championship side at Stangmore Park.
The game was deadlocked after 90 minutes, with Ryan Doherty’s equaliser 11 minutes from the end wiping out Paul McElroy’s opener for Dungannon.
But then in extra time the Swifts were handed a break, to squeeze through to the next round by the narrowest of margins.
The Swifts had yet to win a game this season and boss Rodney McAree took no chances with his team selection.
His squad was almost at full strength, featuring eight of the players that started the final against Ballymena.
Dungannon went close in the ninth minute when Rhyss Campbell took aim from the edge of the box, but the goalkeeper blocked.
There was a handball shout for Limavady when Robbie Hume and Gary McFadden combined to tee up Stephen Duffy. His strike looked to hit a defender, but the referee waved play on.
The Swifts lost Grant Hutchinson to injury, with Cormac Burke - who scored in last season’s final - coming on.
After 27 minutes Kris Lowe’s cross picked out Burke, who turned and hit a low shot which the goalkeeper got down to save.
Dungannon had two big chances late in the first half.
An ambitious effort from McElroy looked to be curling towards the top corner, but the goalkeeper got across to push it away.
From the corner, the ball reached Harpur, whose header hit the bar before bouncing to safety.
Limavady had a lucky escape just before the break when a penalty was awarded for a foul on Jarlath O’Rourke - but the assistant had spotted an offside beforehand, and the decision was reversed.
The second half began with an effort from Hume working the home goalkeeper, before Stephen Duffy shot wide from a great position for the visitors.
The Swifts fans were growing nervous, but then McElroy struck to ease the tension.
He took a pass from O’Rourke and hit a shot which appeared to take a deflection as it entered the net.
McElroy went close to a second with an eye-catching looping effort, but it was saved.
Lowe also threatened after receiving the ball down the right channel, cutting inside but shooting wide of the target.
Those missed chances came back to haunt the Swifts when Limavady equalised in the 79th minute.
Gareth McFadden supplied the cross, Doherty’s shot was blocked but he followed up at the second attempt.
Ally Teggart had a blistering strike saved deep in stoppage time for the Swifts.
Extra-time followed and chances came and went for Dungannon.
But then in the 119th minute they nicked it, with a cross from Mark Patton bouncing in off a Limavady defender to send the Swifts through.
DUNGANNON SWIFTS: Addis, Lowe, Clucas, Hegarty, O’Rourke, Hutchinson (Burke, 17), Harpur, McMullan (Lafferty, 66), Teggart (Soares, 97), Campbell (Patton, 66), McElroy
Subs not used: Coney, Marcal, Gallagher
LIMAVADY UTD: Wells, O’Kane, McMullan, Doherty, Gary McFadden, O’Connell (Scarlett, 75), Hume, Duffy (McGurk, 65), Boyle, Gareth McFadden, Friars
Subs not used: Brown, Smallwoods
Referee: Gareth Stewart