The Dale had the better first half and Ian Henderson deservedly put them ahead just before the break. However, Lucas Moura pulled Spurs level early in the second half, before Harry Kane’s late penalty looked to have sealed the tie.

Astonishingly, Steve Davies equalised at the death to deny Mauricio Pochettino’s side an immediate passage into the quarter-finals.

The visitors got off to a shaky start and were perhaps fortunate not to concede a penalty around the quarter-hour mark. Referee Bobby Madley turned down handball appeals against Toby Alderweireld.

Nevertheless, they could have gone in front in the 26th minute, but wasted two good chances in quick succession.

First, Son Heung-Min’s close-range shot was kept out by Josh Lillis. Then, after the ball fell back to the South Korean, he passed it across to Moussa Sissoko, who teed up Fernando Llorente. The Spaniard took his time getting the shot away, but fired wide of the post when he eventually did.

Six minutes later, the hosts nearly took the lead. Henderson beat the offside trap after being played through on goal by Callum Camps. However, he somehow put the ball wide of goal.

However, the captain made amends on the stroke of half-time. Another perfectly-timed run saw him set up by Andrew Cannon. This time, he made no mistake, slotting home the opening goal.

In the 59th minute, Moura netted a vital equaliser – his first goal for the club on his first start. Sissoko’s pass set the Brazilian up and he lifted the ball over the onrushing Lillis and into the net.

Not long after, Victor Wanyama spurned a magnificent opportunity to put Spurs in front. The ball was flicked to him at the far post following a corner. However, he was unable to control it under pressure and looped it over the bar from right in front of goal.

There was more drama as Dele Alli won a soft penalty off Harrison McGahey in the 87th minute. Kane drilled the spot-kick into the bottom corner.

Just as it looked as if the game was finished, Tottenham failed to deal with a cross and Steve Davies took full advantage. He was at the far post to slot the ball into the net in the third minute of stoppage time and force a replay.