Birmingham City came from behind twice to beat League 1 opposition Coventry City 4-1 on penalties following a 2-2 draw in the FA Cup Fourth Round replay at St Andrew’s.

Goals from captain Harlee Dean and substitute Jérémie Bela, in stoppage time and the 120th minute respectively, were enough to throw the Blues a lifeline and take the tie to the lottery of a penalty shoot-out.

The Championship side looked off-the-pace for most of the match and spent much of it on the back foot, desperately clawing out threatening play from Coventry’s target man, Amadou Bakayoko. The Sierra Leonean proved to be a headache for Birmingham’s defence.

The Sky Blues, who ground-share St Andrew’s with Birmingham, reaped the rewards of their attacking pressure shortly after half-time when Bakayoko’s deflected shot found its way into the net in front of the 4000-strong visiting contingent.

Coventry continued to be on top for the remainder of the game, but, right at the death, Birmingham City crushed the FA Cup dream when captain Harlee Dean glanced a header from close range into the bottom-left corner, bringing the scores to level-pegging.

The visitors took the lead once again when a delightful build-up phase was finished with aplomb by Maxime Biamou, unmarked in the box and just 12 yards out.

Just as the visiting Sky Blues thought they had won the second running of the West Midlands derby, a cross-cum-shot from Jérémie Bela crashed in off the post with the last kick of the match, earning Birmingham another chance at progressing into the fifth round.

Blues ‘keeper Lee Camp shone in the penalty shoot-out, making two sensational saves to deny Coventry City. Goals from Lukas Jutkiewicz, Bela, Gary Gardner and Dean rounded off the spot-kicks at 4-1 to the hosts.

It was a cruel finish to the game for underdogs Coventry City, who looked to have that elusive extra half-yard over their Championship counterparts.

After his team’s grinded victory, Birmingham City manager Pep Clotet said: “It was a fantastic match. Levels don’t matter in the FA Cup. Coventry made it very difficult for us.”

Birmingham’s late resurgence earned them a visit to the King Power Stadium to face Premier League Leicester City in the fifth round. The sides have not met since the 2013/14 season, when Leicester claimed two wins out of two in the Championship.