Leon Clarke fired an injury time winner to put Coventry City in the FA Cup third round.
Clarke's first half goal appeared to be sending City through against Hartlepool but Jack Baldwin drew the League Two side level three minutes from time.
The tie appeared to be heading into extra time but when Scott Flinders saved Carl Baker's shot, Clarke was on hand to score his second of the night and his 14th of the season.
Steven Pressley restored Leon Clarke and Carl Baker to the starting line-up in the absence of Chris Maguire and Chris Dagnall.
But there was an early chance for the visitors as Jonathan Franks made room for a shot but his effort was blocked by Dan Seaborne.
Callum Wilson broke clear in the fifth minute but, just as he was about to fashion a shooting chance, Jack Baldwin made an impressive tackle to keep City at bay.
John Fleck was pulling the strings for Coventry early on with his range of passes, one of which almost set up Leon Clarke but he was denied by some last ditch defending.
City fashioned a wonderful chance in the 14th minute thanks a patient build up which led to a low cross from Cyrus Christie. Leon Clarke looked set to open the scoring from point-blank range but Scott Flinders made a sensational reflex save to deny the striker.
While Fleck's passing was unlocking Hartlepool, Conor Thomas was working tirelessly in midfield to make sure the visitors had no time in midfield or at the back.
City were firmly on top in the first half and skipper Carl Baker tried his luck with a 25-yard free-kick in the 22nd minute but his effort was just off target.
Hartlepool got a sight of goal in the 29th minute but Franks' low shot from a tight angle was comfortable for Joe Murphy to save low down.
The Sky Blues' ascendancy dropped slightly as a few long range passes went astray but a good move led to Clarke setting Wilson clear but, again, a solid Hartlepool tackle - this time from Christian Burgess - stopped him in his tracks.
City took the lead in the 35th minute and it was no surprise that it was from a Fleck through pass. The Scot threaded the ball through the visitors' defence and Leon Clarke finished coolly past Flinders.
Wilson won the ball back from a Hartlepool defender in the 42nd minute but his low drive from distance was easy for Flinders to clutch onto.
The Sky Blues almost doubled their lead with a superb counter attack a minute before half-time. Fleck fed Wilson, who played in Christie but his effort was over the bar as he cut in on his left foot.
Clarke came close to grabbing his second just two minutes into the second half when he almost squeezed the ball under Flinders from a tight angle but the keeper managed to prevent it crossing the line.
Moussa played a pass in front of Clarke in the 54th minute and the Coventry striker raced through and challenged the goalkeeper. The ball broke free, but Hartlepool just managed to clear their lines.
There were few shooting chances in the first quarter of an hour in the second half but Baker did fire one from range in the 59th minute only to see Flinders handle with ease.
The Sky Blues were limiting their opposition to very few chances and Matty Dolan was forced to shoot from 30 yards in the 62nd minute but he was well wide.
City produced a lovely, patient passing move in the 65th minute which saw Blair Adams cross for Clarke but he headed wide.
Baker stung the hands of Flinders in the 72nd minute when he his a rasping left foot shot from the edge of the box and the Pools keeper did well to save.
Pressley's side produced a wonderful move again in the 78th minute which saw Baker set Christie free down the right. He found Wilson but his shot skimmed off a Hartlepool defender and hit the bar.
The only danger for City was, for all their dominance, Hartlepool might nick a goal and Dolan tried again from outside the box with nine minutes left but fired wide of Murphy's post.
But the visitors did grab an equaliser three minutes from time when Jack Baldwin headed in at the near post from an inswinging corner.
Coventry almost regained the lead in injury time when Baker crossed for Clarke, but the striker headed wide.
But it was that same combination that won it for City with just seconds remaining as Baker's effort was parried by Flinders and Clarke side-footed home to set up the tie with Barnsley.
Coventry City: Murphy, Christie, J Clarke, Seaborne, Adams, Baker (c) (Webster 90), Thomas, Fleck, Moussa, L Clarke, Wilson (Daniels 84).
Subs: Gott, Barton, Phillips, Garner, Haynes.
Hartlepool Utd: Flinders, Austin, Dolan, Baldwin, Franks (Collins 83), Walton (c) (Poole 69), Monkhouse, Compton (James 56), Duckworth, Burgess, Walker.
Subs: Rafferty, Sweeney, Holden, Rodney.