The celebrations around the Longford bench at the end suggested that even Stephen Kenny's side were surprised by their latest achievement in what has already been a remarkable season.
Of late though, their league form has dipped badly and, in the circumstances, yesterday's hosts had gone into this game as strong favourites.
They lived up to the tag early on, but thereafter only in spells and at the end, when they had lost out to the visitors in a good and sometimes compelling cup encounter, it can only have added to their sense of dismay at the defeat.
When he emerged from a very subdued dressing-room, manager Derek Mountfield coped admirably with the task of putting a brave face on his team's latest setback.
Talk of taking nine points from the three upcoming home games seemed fanciful, however, after a game in which they had led, had more of the ball and created the lion's share of the chances, yet still lost. The truth is that City's season looks to be in tatters.
In the Longford camp, there was no attempt whatsoever to hide the delight at their reward for yesterday's win, a visit by St Patrick's next month.
But Stephen Kenny's immediate thoughts centred more on the performance that had earned his current side a crack at his old one.
The first-half heroics of goalkeeper Stephen O'Brien clearly deserved a special mention, as did the finishing of Niall Byrne and, in particular, Stuart Byrne.
Perhaps the most telling remark was Kenny's assertion that
"at half-time I pointed out to them that this was the third time they'd trailed Cork by a goal at the break this season and they hadn't lost on either of the other two occasions".
A neutral would surely have found it more difficult to be so upbeat with Kenny's players at that stage. City had made by far the stronger start to the game and, until a couple of minutes before the interval, enjoyed a complete monopoly of the scoring opportunities.
They had taken one of four pretty clearcut ones when, after 35 minutes, Ollie Cahill's cross from the right reached Derek Coughlan via a deflection and the local centre-half's shot deflected past O'Brien, but there should have been more.
After a fairly scrappy first half, though, it was Kenny's men who set about their business in the second with a greater sense of purpose.
Shay Zellor went desperately close to equalising within moments of the restart and, from then on, his team's passing improved noticeably, especially when they attempted to play the ball out of defence.
Before City had found their tempo again, the two sides were indeed level, the deflection off the wall of Wes Byrne's poor free-kick prompted a spectacular volley from Stuart Byrne.
From then on, the fate of the home side, whose full backs were both among the players having difficult days, always hung by a thread.
In fact, the whole defence was to blame for the second with Zellor enjoying far too much time unchallenged on the ball before threading it through to the unmarked Niall Byrne.
While Michael Devine almost saved the day by sprinting off his line to smother the initial shot, the young striker scored at the second attempt.
As City threw bodies forward in search of an equaliser late on, Derek Coughlan came close to stealing an equaliser, but Paul McNally cleared off the line on that occasion and Mark Herrick then dealt a further blow to his own side by getting sent off for a senseless piece of retaliation on Stuart Byrne.
In contrast, Byrne and co kept their heads to the very end despite a good deal of pressure and, for that alone, they probably deserved their place in the next round.
CORK CITY: Devine; O'Brien, Coughlan, Napier (Daly, 90 mins), O'Halloran; Caulfield (Tynan, 64 mins), Herrick, Gaughan (Flanagan, 83 mins), Cahill; Morley, Mulligan.
LONGFORD TOWN: O'Brien; Murphy, Smith, McNally, W Byrne; Gavin, V Perth, S Byrne, Prunty (Coyle, 23 mins); N Byrne (Notaro, 88 mins), Zellor.
Referee: J McDermott (Dublin).