Ciaran Kilduff's scrambled injury-time goal earned Shamrock Rovers a quarter-final spot.
Extra-time loomed with Rovers cancelling out Coleraine's first-leg lead courtesy of an early Mark Quigley goal.
But then Kilduff reacted fastest as the Coleraine defence failed to clear a cross and he stabbed the ball past 'keeper Michael Doherty.
Earlier, Doherty had denied James Chambers when he brilliantly touched his shot on to the crossbar.
Rovers, impressive in the opening stages, took the lead and levelled the tie after only six minutes. Gary McCabe's right-wing cross left Doherty uncertain about coming off his line for the ball. As he delayed, Quigley outpaced the home defence, ran into the space and crashed a volley into the net from six yards.
Coleraine looked to be on the ropes and McCabe attempted a speculative long-range shot which drifted wide. However, the visitors ran out of steam and Coleraine gradually eased their way into the game.
Stephen Lowry and Paul Owens combined to produce Coleraine's first opening after 27 minutes but Lowry could not get the direction on his header inside the box.
Then lone striker Shane Jennings sent a shot just wide when Owens' corner was flicked on by Lowry and winger Joel Bradley headed an Owens centre straight at 'keeper Barry Murphy. Lowry worked an opening for Ruairi Harkin but Murphy got down low to his right to snatch the ball.
Only a save by Doherty and the woodwork saved Coleraine from falling further behind in the second half.
When Owens went charging through at the other end Rovers' skipper Pat Sullivan sent him to ground and was relieved to see only a yellow card issued by Arnold Hunter.
Rovers finished with a flourish and it was left to Kilduff to punish Coleraine defence, drilling his shot past Doherty.
Coleraine – Doherty, Canning, Beverland, Ogilby, McIlmoyle, Bradley, Hegarty, Harkin, Lowry, Owens, Jennings (Allen 42).
Shamrock Rovers – Murphy, Sullivan, Powell, Foran, McGuinness, McCabe (Kilduff 69), Quigley, Finn, Chambers, O'Connor (Stewart 77), Robinson.
Ref – A Hunter