Sam Bell scored a superb winner nine minutes from the end of extra time to book Bristol City a place in the fourth round of the FA Cup with a 2-1 win at Swansea.
The Robins substitute cut in from the left and fired past goalkeeper Andy Fisher to settle the replay and reward his club with a home tie against West Brom.
It was 20-year-old Bell’s first senior goal for the club.
Mark Sykes’ third goal in two games had put Bristol City ahead against the run of play with a composed finish after a slick move just past the hour, but Swans substitute Ollie Cooper levelled the scores in the 73rd minute, seconds after coming on.
Swansea pressed hard for a second equaliser following Bell’s effort, but Kyle Naughton flashed a shot inches wide.
It took Swansea seven minutes to fashion the first opportunity – a low drive from the edge of the box by Olivier Ntcham which was saved by goalkeeper Max O’Leary.
An intricate move by Russell Martin’s side seemed to open up space for Joel Piroe inside the box in the 18th minute, but the Dutch striker was unable to get his shot away before he was crowded out.
The Swans maintained their pressure and almost went ahead when Bristol City defender Zac Vyner made a hash of a clearance and nearly sliced the ball past a startled O’Leary.
The home side dominated possession, as they normally do, but struggled to carve out clear-cut opportunities.
The Robins’ threat was even more fleeting, with last Saturday’s four-goal burst against Birmingham a distant memory as they failed to muster a single shot in the opening half.
The visitors showed more ambition in the early stages of the second half and when a loose ball fell to Antoine Semenyo, the striker fired a shot wide of the near post.
That sparked Swansea into action and O’Leary was forced into another fine save to parry away a rasping drive from Joel Latibeaudiere, before Piroe also fired just wide.
It felt as though the Swans were building towards finding the breakthrough, but O’Leary again proved decisive in saving a curling effort from Cameron Congreve.
When it arrived, the opening goal came from the visitors, with Sykes timing his run to perfection and slipping the ball under Fisher after a defence-splitting pass from substitute Bell.
But the lead only lasted 11 minutes before the Swans levelled through Cooper.
The midfielder was alert enough to stab the ball home from Matt Grimes’ cross for his sixth goal of the season.
Neither side was able to find a winner in the closing stages and the tie went to extra time.
Swansea substitute Liam Cullen had a chance to put his side ahead in the first period but headed over from six yards.
Liam Manning then had a shot tipped over the crossbar by O’Leary as the Swans pressed.
Bristol City went close in the second period but Semenyo’s cross was just out of the reach of Bell, who won it late on.