Controversy reigned at a raucous Dalymount as Cork City pulled it out of the fire to save their season.
Dinny Corcoran's goal seemed sure to have decided this enthralling Irish Daily Mail FAI Cup semi-final tie but a Kieran Sadlier penalty late on ensured a Turner's Cross replay on Monday week.
There was no getting away form Bohs' superiority and they arguably deserved a first FAI Cup final berth in a decade.
JJ Lunney was outstanding in an engine room in which the industry of Keith Buckley ensured little joy for a below-par City.
The Leesiders' season has tailed off, giving up their league title extremely tamely, but they rescued it here with a game response when time was no longer their ally.
Cork's worst run since he took charge saw John Caulfield drop both captain Conor McCormack and Graham Cummins, whose season has tailed off considerably in recent months.
Alan Bennett came in for a rare start at the back, while Bohs returned to the team that beat Derry in the quarter-final.
Cork began brightly and nice play from Sadlier put Ronan Coughlan into a crossing position but he ballooned his delivery. However, Bohs ought to have gone in front on seven minutes.
Dan Kelly found Keith Ward who was given far too much time, allowing him to dink a splendid cross in; however, Kevin Devaney's header went wide when he really should have done better.
Moments later Sadlier headed over from a Karl Sheppard corner.
The game's best chance to date came on the half-hour mark.
City squandered possession, Dinny Corcoran played in Ward but Mark McNulty narrowed his angle and blocked with his feet. Cork had their share of first-half corners, Coughlan heading to Supple's right and wide with the latest one.
Cork have a controversial penalty as Leahy wins the ball but also takes the man. It's a harsh one, what do you think? pic.twitter.com/oWvK98ojRC— Soccer Republic (@SoccRepublic) September 30, 2018
The game entered a lull until an outrageous Devaney strike on the stroke of half-time had McNulty beaten but thudded off the post.
Cork were shaky at the back and should have gone behind just after the restart. Daniel Kelly, switched to the left wing, lacked any power of note after Keith Buckley but him clean through.
Moments later, Devaney was superbly denied by McNulty.
City's sloppy defending is most unlike what we have come to expect, at least until recently, and Corcoran might well have scored with a better connection nine minutes after the break, shortly before Cummins came on for Coughlan.
The lead goal finally arrived on 68 minutes and Ward was heavily involved, not panicking in possession and finding Leahy, who fed Devaney down the left. Corcoran had ghosted free of McLoughlin, who seemed to get caught out ball-watching, and tapped in from a matter of yards.
Cummins, so strong in the air, forced a smart save from Shane Supple as Cork rallied, with Dalymount rocking. Ward left the pitch soon to a standing ovation. It was merited.
Bohs seemed in control but it all changed with three minutes left.
Substitute Conor McCarthy got to the ball at the edge of the box before Leahy jumped in with a needlessly rash challenge to give Sadlier the chance to restore parity.
Bohs had strong claims for a penalty right at the death, with Corcoran seemingly held by Alan Bennett, but referee Rob Rogers instead blew for full-time.
It was pulsating stuff and more of the same seems likely in eight days' time as Dundalk wait in the wings for the victor.
Bohemians: Supple, Leahy, Casey, Morris, Pender, Devaney, Buckley, Lunney, Kelly (Grant 90), Ward (Byrne 76), Corcoran.
Cork City: McNulty, Griffin, Bennett, McLoughlin, Beattie (McCarthy 65), Keohane, Morrissey (McNamee 74), Buckley, Sheppard, Coughlan (Cummins 56), Sadlier.
Referee: Rob Rogers.