Matt Smith was the hero and villain for Oldham as Chesterfield began the defence of the Johnstone's Paint Trophy with a 2-1 victory over the team they beat in last season's Northern Area final.
Smith gave Oldham a first-half lead but scored an own goal in added time after Danny Whitaker had equalised and then seen a penalty saved by Dean Bouzanis.
Oldham deserved to go ahead when Lee Croft's right-wing cross was headed in by Smith at the back post but a mistake by Bouzanis should have put Chesterfield level but Dean Richards could not turn the ball into the empty net before Mark Randall fired over.
But the home side equalised three minutes after the break when a poor header from Carl Winchester allowed Whitaker to run clear and score.
Whitaker was denied by a fine save from Bouzanis, who then rescued Oldham when he brilliantly kept out the midfielder's 62nd-minute penalty after Richards was tripped by Jonathan Grounds.
Oldham nearly won it in the 85th minute when a 25-yard drive from Connor Hughes came back off the bar but Smith's night turned upside down when he headed a cross by Drew Talbot into his own net in stoppage time.