Cheltenham hit the jackpot as they overcame Chester to set up a FA Cup fourth round encounter with Newcastle United.
John Ward's side were made to fight every inch of the way, but Kayode Odejayi's 52nd-minute goal eventually proved to be enough.
In fairness, the visitors had enjoyed the better of the chances, while Chester struggled to breach a well-marshalled defence.
Chester had the better of the opening exchanges and a half-chance came their way on 15 minutes when Brian Wilson needlessly gave the ball away to Michael Branch, who raced through on goal but was denied by a great challenge by Craig Armstrong.
The Robins' first effort came the way of Wilson after 24 minutes when he was found unmarked on the penalty spot, but the bounce of the ball made it difficult for him to connect properly with his first-time effort which went harmlessly wide.
A Ben Davies cross just after the half-hour mark had the visitors in trouble, but Scott McNiven could only scuff his effort straight at the keeper.
Four minutes after the interval JJ Melligan forced City keeper Stephane Gillet into a save at his near post, but the visitors did not have long to wait for the opener.
It came just three minutes later, when Odejayi hit a left-foot strike into the back of the net as the home defence appealed for offside.
With 20 minutes to play Chester opted to go for broke with striker Marcus Richardson being thrown into the forward line in place of midfielder Justin Walker.
However, it was still Cheltenham who looked the more likely to score and six minutes from time, Odejayi had a chance to kill the game when clean through on goal, only to see Gillet block his effort.
It was the same three minutes later as the Chester keeper bravely blocked another one-on-one opportunity for the visiting striker.
Town were made to suffer an additional three minutes of added time, but ultimately held on to set-up a home clash with the Premiership giants.