A 25 yard strike from Danny Brooks secured Stamford's passage past FC United of Manchester in the FA Trophy at a packed Kettering Road this afternoon.
The Daniels fought back after conceding an early Mike Norton goal to win 2-1 in front of more than 700 fans, with Gary King levelling early in the second half and Brooks cracking in the long range winner in the 83rd minute.
Norton had given the visitors an early lead, cracking a low left-footed shot past Matt Finley after a poor clearance from inside the Stamford penalty area.
United had the bulk of the first half possession with Norton crashing a header against the bar but otherwise the Manchester side were off target and Finlay was well protected by centre backs Tom Batchelor and skipper Richard Jones and The Daniels gradually grew into the game with Andy Hall having their first half best chance - a low shot pushed wide for a corner - towards the end of the half.
Five minutes after the break King took advantage when James Spencer spilled the ball and the Stamford striker bent the ball around the last defender to equalise.
Spencer went off soon afterwards, suffering concussion and without a reserve keeper on the bench, David Birch was forced to pull on the goalkeeper's jersey for the remainder of an evenly-balanced second half.
Then with just seven minutes left on the clock Danny Brooks struck, powering the ball over Jones to spark celebrations on and off the pitch.
United had further chances but Stamford were resolute in defence and despite having greater possession and more shots they rarely troubled Finlay in the Stamford goal.
The Daniels had been forced to make changes with Luis Hamilton and Michael Jacklin cup-tied but manager Graham Drury also made tactical changes with Tom Bathcelor, David Staff, Gregg Smith and Jack Cotton, playing in front of the back four, all brought into the starting XI.
At full-time Drury said: "We went behind again but we have that determination not to lose.
"I think we got the tactics spot on. I was really pleased with Jack Cotton, David Staff and Greg Smith, who have not played 90 minutes often this season."
The draw for the next round is on Monday, when the Blue Square Bet Conference League sides enter the draw and with several of Stamford's side and management hoping to face their former side - Corby Town.
Stamford now have two tough league games coming up with a trip to leaders Coalville Town on Tuesday evening, and the visit of seventh-placed Sheffield FC to Kettering Road on Saturday.
Stamford: Matt Finlay, Robbie Maddox, Paul Mayo, Tom Batchelor, Richard Jones, Jack Cotton, Andy Hall, David Staff, Greg Smith, Gary King (Sam Mullarkey), Danny Brooks. Subs Unused: Dean West, Joe Hopewell, Joe French, Richard Stainsby.