Barnsley's promotion bid received a set back as they suffered their first home defeat of the season against a Chesterfield side that had previously not won away since Boxing day of last year.
But the struggling Spireites thoroughly deserved the three points that will boost their survival bid.
They created the better chances, worked harder for the cause, and their efforts were finally rewarded 10 minutes from time when former Barnsley man Glynn Hurst used his pace to go clear of the home defence before showing splendid composure to tuck a low shot past goalkeeper Sasa Ilic.
Barnsley were shocking, which was all the more surprising after two successive victories on the road at Luton and Hartlepool.
They never got out of second gear and it was the visitors who carved out the best early opening on 12 minutes when striker Marvin Robinson headed over from 10 yards.
Barnsley's best effort of the first half was a Steve Hayward free-kick which was saved underneath his own bar by Carl Muggleton.
Hayward was perhaps fortunate to stay on the field on the half hour mark when as the last man he appeared to bring down Hurst but referee David Pugh waved play on.
The visitors could have made the breakthrough just before the break but a deflected effort from captain Mark Hudson flew inches wide and then Hurst saw a 12 yard drive brilliantly blocked by the advancing Ilic.
Barnsley tried to lift the tempo in the second half but the Chesterfield defence were in resolute mood and even when sub striker Isaiah Rankin was introduced by Barnsley boss Gudjon Thordarson, it was the visitors who continued to look the more likely side to snatch victory.
On 76 minutes only a good tackle by Gary Monk prevented Chesterfield sub David Reeves from getting in a shot, but four minutes later Hurst popped up to give his side the lead.
With Barnsley pressing forward, the visitors almost doubled their tally when substitute Chris Brandon sent a shot crashing against the post.