Peter Clarke’s header in second half stoppage time won the game for 10-man Oldham Athletic against Chesterfield.
The defender headed home Aiden O’Neill’s excellent cross in the 91st minute to win the game for Athletic.
Latics were reduced to 10 men at the end of the first half as Anthony Gerrard was sent off for a second bookable offence.
The result takes Athletic above the Spireites in the Sky Bet League One table.
Manager John Sheridan named two of his deadline day signings in the squad as O’Neill took his place in midfield alongside the returning Chris Taylor.
Latics had the first opportunity of the game in the first 10 minutes as Ryan Flynn played to Ryan McLaughlin but his effort from the edge of the box was saved by Ryan Fulton.
Troubling signs followed as Connor Ripley went down with an injury but was fortunately able to continue.
Ched Evans had a shot blocked on the edge of the box on seven minutes before Oldham Athletic started to take the game to the Spireites.
Taylor almost stole a march on his defender at the back post before Chesterfield managed to clear the danger, whilst a minute later, Flynn’s low cross almost deceived the defence but was cleared.
O’Neill was making a real impression in the centre of the park, controlling the ball well and creating attacks.
Midway through the first half, Latics almost took the lead as Rob Hunt, who was making his full debut, threw long into the box, Flynn flicked it on to Aaron Holloway but Fulton managed to make a save.
Chesterfield had a golden opportunity to take the lead on the half hour mark as Sadiq El Fitouri’s low cross found Dan Jones racing in at the back post but the full back ran ahead of the ball and fluffed his lines in front of goal.
In the middle of that attack for the Spireites, Gerrard picked up a booking for a foul off the ball on Evans.
Flynn had a shot saved by Fulton five minutes before the break whilst on the stroke of half time, Holloway managed to race away with the ball, fed McLaughlin to strike but the goalkeeper made the save.
The referee blew the half time whistle, but in incidents which would follow, he booked Gerrard for the second time and Latics played the second half with 10 men.
Sheridan elected to make a change at the break as Flynn was replaced by Paul Green and the Spireites looked to make their advantage count in the second half.
Latics lined up in a 4-3-2 formation with McLaughlin at right back and Taylor partnering Holloway up front.
Chesterfield started brightly, forcing a number of corners with the final one headed over by midfielder Jon Nolan.
However, Athletic managed to get a foothold in the game and were defending excellently to keep Chesterfield quiet.
Chances were few and far between in the second half but the Oldham Athletic supporters were in fine voice and did not stop singing throughout.
Chesterfield midfielder Nolan struck over on the hour mark as it was a battle of the midfields.
Holloway battled on 72 minutes to get away from two defenders but was unable to get his shot away.
David Faupala thought he had given Chesterfield the lead on 75 minutes as he struck towards goal but it went behind instead of on target.
O’Neill was proving more and more influential on the game and he won a free kick into the final 10 minutes of the game.
He stepped up and forced Fulton to push the ball out but unfortunately it went past Holloway who could not convert.
Athletic continued to frustrate their opponents and as seven minutes of stoppage time was announce, they struck.
O’Neill’s excellent cross found Clarke onrushing at the back post and he headed Latics into the lead and effectively won them the game.
Athletic saw out the game comfortably in the final minutes of the game and sealed a vital three points.
Chesterfield: Fulton, Evatt, Jones (Martinez 64’), Nolan (Brown 64’), Evans, Donohue, Faupala, Gardner, Grimshaw (Simons 81’), Anderson, El Fitouri.
Subs not used: Allinson, Maguire, Dennis, Mitchell.
Oldham Athletic: Ripley, Wilson, Gerrard, Clarke, Hunt, Taylor (Obadeyi 78’), Fane, O’Neill, Flynn (Green 46’), McLaughlin, Holloway (Osei 90+3’).
Subs not used: Law, Reckord, Banks, Ngoo.
Goals: Chesterfield 0-1 Oldham Athletic (Clarke 90+1’)
Attendance: 6,375 (883 visiting supporters)