Brentford's nine match unbeaten run was brought to an end at Griffin Park as Chesterfield scored the only goal of the game to take the points.
The Bees lost for only the second time at home this season in a game they largely dominated as the visitors hit them with a goal scored by Martin Gritton.
The crucial goal came eight minutes into the second half when Jack Lester found space 30 yards out and picked out strike partner Gritton with a fine through ball which the powerful striker curled past the helpless Ben Hamer from 12 yards without breaking stride.
The goal came very much against the run of play as Brentford had pushed the visitors back for long periods of the first half but Chesterfield grew in confidence after the goal and did enough to merit the win.
It could have been different if Brentford had scored in the first period - and they went in at half time wondering how they hadn't, as after a slow start they had the upper hand.
The Bees almost scored early on when Derek Niven headed a David Hunt long throw past his own post and Sam Wood had a shot blocked soon after.
Jordan Rhodes shot wide and Wood had another shot blocked later in the half.
Gritton had headed wide when well placed early on and the ever-dangerous Drew Talbot also curled an effort off target from 18 yards.
Charlie MacDonald had a golden chance for The Bees midway through the first half when Rhodes fed Wood and his cross with the outside of his left foot found Brentford's top scorer eight yards out but his header was saved low down by Tommy Lee.
Mark Phillips had a header saved and Wood shot wide as Brentford began to dominate and Lee had to turn a Ryan Dickson cross around the post when it looked like it was arrowing in.
Marcus Bean shot over soon after before MacDonald teased the Chesterfield defence before firing in a low cross than neither Rhodes nor Wood could turn home - when Wood won the ball back and put in a low ball Rhodes shot over.
Lester had fired over late in the half for the visitors before Talbot had a shot saved and then fired wide but Brentford continued to dominate.
Niven had to produce a fine tackle to deny Rhodes early in the second half and the evening changed when the on-loan striker limped off soon after and Gritton stroked Chesterfield ahead.
Adam Newton shot over soon after and substitute Sam Williams turned a volley over from close range but Chesterfield should have sealed it when Talbot picked up a poor John Halls back pass and rounded Hamer - the Brentford stopper pushed him wide but the wide man should still have scored rather than hitting the post.
Hamer saved well from Talbot soon after and the wide man then shot over when he was racing clear with only the Brentford keeper to beat.
Dickson had a shot blocked for the home side and Hunt shot wide twice when well placed as Brentford tried to find a leveller.
MacDonald could have secured one when he shot over from ten yards after Dickson had darted into the box and Lee had to save brilliantly from an acrobatic Bean effort late on.
But the visitors defence held firm and Chesterfield left with the points.
Brentford: Hamer; Halls, Phillips, Bennett, Dickson; Newton (sub M. Williams 70 mins), Hunt, Bean, Wood (sub Johnson 60 mins); MacDonald, Rhodes (sub S. Williams 51 mins)
Subs (not used): Simon Brown, Osborne, M. Williams
Chesterfield: Lee; Wilson, Hall, Downes, Robertson; Lowry, Montrose, Niven, Talbot; Lester, Gritton
Subs (not used): Austin, Currie, Kerry, Gray, Till
Attendance: 4,541 (162 away fans)
Written by Chris Wickham