Morecambe substitute Garry Thompson struck a dramatic late winner to earn his side a historic FA Cup victory at Chesterfield.
Thompson lifted the ball over stranded Spireites keeper Carl Muggleton in the 93rd minute after shrugging off a challenge from Steve Payne.
Gareth Davies seemed to have spared Chesterfield's blushes with an equaliser 16 minutes earlier, but the win was more than the Shrimps deserved after Lee Elam had earlier put them ahead.
The visitors started brightly and had the first chance of the tie after just 40 seconds when Danny Carlton fired straight at Muggleton after Elam's flick gave him the space to shoot.
James Bentley then headed Adriano Rigoglioso's corner over for the visitors from six yards when it looked easy to score.
However, after 13 minutes the home side finally threatened Morecambe's goal and had two good chances stopped within the space of a few seconds.
First midfielder Chris Brandon saw a close-range effort cleared off the line by Iain Swan then Mark Allott nodded over from under the crossbar.
The visitors bounced back and almost took the lead when Stuart Howson struck the inside of his own post as he tried to cut out Carlton's low cross. But the Conference side did go ahead just before the break when Elam slotted past Muggleton after Carlton's header put him through on goal.
Chesterfield played with more urgency after half time as Morecambe tried to hold on to their lead.
Substitute Glynn Hurst came close with two efforts before Davies controlled Rob Edwards' cross and slid the ball past Craig Mawson from a tight angle.
As the game moved into stoppage time Brandon almost won it for Chesterfield but his long-range effort was deflected over and moments later Thompson struck at the other end to spark jubilant scenes