Ronan Finn and Ciaran Kilduff provided the goals late in each half to book holders Shamrock Rovers’ place in the semi-finals of the EA Sports Cup as both sides finished with 10 men at Tallaght Stadium.
The result sets up a Dublin derby meeting in the last four as Rovers travel to face Bohemians at Dalymount Park on August 4.
Bringing a 10-match unbeaten run into the game, Cork didn’t lack confidence and they might have been in front within five minutes.
Josh O’Shea and Garry Buckley combined to set up John Kavanagh whose shot deflected off Rovers’ skipper Conor Kenna and came back of a post.
In the move of the half, terrific work by Finn, Gary McCabe and Luke Byrne carved Cork open. Eamon Zayed failed to apply the finish when glancing his header wide.
The game boiled over, however, just after the half hour with six cards issued, two of them red.
It started with Bayly being booked for an over-the-top challenge on John Kavanagh, for which the Cork winger was also mysteriously yellow-carded.
Rovers’ McCabe was also booked for dissent following that incident.
But the red mist really descended a minute later when Cork’s Garry Buckley and Hoops’ Finn squared up to each other after a challenge in the middle of the park.
In the scuffle that followed Cork’s Dave O’Leary went to ground.
When some calm was restored Buckley was shown a straight red card by referee Paul Tuite as Finn escaped any censure.
McCabe was then shown a second yellow and dismissed after Tuite consulted with both his assistant, Rhona Daly, and fourth official, Derek Tomney.
That provided the main talking point of the first half, despite Finn giving Rovers the lead three minutes before the break.
The Rovers’ midfielder rattled a volley from Simon Madden’s low cross off the crossbar and was then there to fire home the rebound.
It was initially all Cork from the restart, John O’Flynn flashing a header from Liam Kearney’s cross wide on 61 minutes.
As in the first half, Rovers worked their way back into it with Bayly shooting wide from Zayed’s cross as Cork’s hopes of getting back into it weren’t helped with skipper John Dunleavy forced off with a head cut.
Sean O’Connor should have doubled Rovers’ lead on 81 minutes.
Played in by substitute Marty Waters’ sublime ball, the Hoops winger’s tame effort was easily saved by McNulty.
The Cork keeper excelled four minutes later, saving well with his feet after Waters got in to shoot.
Rovers’ keeper, Craig Hyland, who’d scarcely a save to make all night, then made a brilliant stop on 88 minutes, pushing Danny Morrisey’s header from Josh O’Shea’s cross onto a post.
Substitute Kilduff added Rovers’ second goal three minutes into added time when shooting home from Waters pass.
Hyland; Madden, Kenna, D. O’Connor, Byrne; Sheppard (Waters, 68), Bayly, Finn, S. O’Connor; McCabe; Zayed (Kilduff, 90).
McNulty; McSweeney (O‘Sullivan, h/t), Donleavy (D. Morrissey, 72), Murray, Davoren; Buckley, O’Leary; Kavanagh, Lehane (Kearney, 15), O’Shea; O’Flynn.
Paul Tuite (Dublin).