Jack Lester's late goal ensured Chesterfield's passage into the final of the Johnstone's Paint Trophy at Wembley, with a 3-1 aggregate victory.
A mix-up between goalkeeper Alex Cisak and Jean-Yves Mvoto allowed Lester to sneak in and score the only goal.
Oldham dominated the game, hitting the woodwork from Shefki Kuqi's shot in the opening minutes, as well as spurning numerous chances in the first half.
But the Spireites nicked it and will face Swindon or Barnet in the final.
VIEWS FROM THE DRESSING ROOM
Chesterfield striker Jack Lester told BBC Radio Sheffield:
"It's amazing, absolutely amazing. I'm delighted.
"Oldham had large chunks of the game, but I think over two legs we probably shaded it and it's just a fantastic night for us, we're delighted.
"It was a tense game, I think Shefki Kuqi had [a chance] late on and it was like [a] heart in the mouth [moment]. I was starting to think when he had his header, which way shall I put my penalty. Then a few minutes later we got the goal - it was a big relief.
"Even then he [the fourth official] put up six minutes and again it got tense so the game was never dead at any stage."