Although Jack Lester scored twice after Wayne Curtis had given Morecambe the lead in the 45th second, the failure to turn dominance into goals proved costly when Simon Grand equalised in the fourth minute of stoppage time.
Chesterfield were stunned but they had only themselves to blame for failing to make the game safe. Jamie Ward, who had an early penalty saved, could have had a hat-trick and other chances were wasted before Grand fired home a spectacular volley.
Morecambe also had their moments and they might have even snatched a victory if midfielder Craig Stanley had done better when twice through on goal.
But it was Chesterfield who controlled an entertaining game after Curtis had punished some slack defending with a downward header at the back post.
The visitors' lead should have lasted just two minutes because Lester was then dragged down by Steven Drench and, after the keeper was booked, he threw himself to his left to beat out Ward's strongly-hit spot-kick.
The chances continued to come and go as Ryan Cresswell thumped a header against the crossbar and Lester shaved a post shortly before the break.
Morecambe continued to hold out against the odds until in the 56th minute when Lester cleverly turned Grand to fire low past Drench for his tenth goal of the season.
Stanley wasted a good opportunity to restore Morecambe's lead before Lester headed Chesterfield in front in the 64th minute after he lost two defenders at the back post.
It only seemed a question of whether Chesterfield would score further goals but, with the clock ticking into the fourth minute of stoppage time, a free-kick was only cleared as far as Grand who let fly with his left foot and Barry Roche could only watch as the ball whistled into the top corner.