Tom Naylor gave the Spireites the lead after half an hour but Trey Ogunsuyi equalised in first-half added-time with a header.
Shrewsbury went in front with 20 minutes remaining when an error from Zach Hemming allowed Ogunsuyi to force home but substitute Tom Pearce levelled with a stunning curling free-kick on 85 minutes.
But there was one more twist when Sam Stubbs headed in on the 93rd minute to pinch the three points for the visitors.
The result is damaging for Chesterfield’s promotion hopes as they fall out of the play-offs.
Here are our player ratings from the game...

5. Malik Owolabi-Belewu 6
Malik Owolabi-Belewu 6 Started tentatively but soon grew into the game, winning tackles and keeping possession. Withdrawn with 20 to go. Photo: Tina Jenner

6. Sammy Braybrooke 7
Sammy Braybrooke 7 Dictated the play from deep again, spreading the ball left and right. Lovely to watch at times. Kept trying to find that killer pass but Shrewsbury stood firm. Photo: Tina Jenner

7. Ryan Stirk 6
Ryan Stirk 6 Played as a number eight in an inside left spot and he caused Shrewsbury some problems with his positioning, forcing one save from Cox, and linking up with Berry nicely. But he didn't come back out for the second-half, replaced by Dobra. Photo: Tina Jenner

8. Tom Naylor 6
Tom Naylor 6 Scored the opener after half an hour, taking a touch before clipping the ball into the far corner from Markanday's cut-back. Off with 20 remaining. Photo: Tina Jenner

