Swindon threw away a two-goal lead at Boundary Park to drop vital points in their battle against relegation.
Oldham hit back with goals from Richie Wellens and Andy Liddell and it was the Latics who went closest to winning and action packed game.
Swindon recently ended a 19-match run without victory away from home and they played with confidence in taking the lead through Sean O'Hanlon and Neale McDermott.
But they were hanging on at the death as Oldham almost completed a hat-trick of league wins.
O'Hanlon put Swindon in front after 12 minutes when he met Jack Smith's corner from the left. The Robins skipper headed past Oldham keeper Chris Day from eight yards despite Day getting a touch.
Chris Porter header over for Oldham before Day made a reaction save from Hameur Bouazza.
Liddell went close with a free-kick but the visitors went 2-0 up within three minutes of the restart.
McDermott hit the bar from the edge of the box and Rory Fallon was fouled by Wellens when they went for the rebound.
Fallon had his penalty saved as Day dived to his left but the ensuing scramble ended when McDermott scored from eight yards via a deflection.
Oldham grabbed a lifeline when a quick free-kick flew into the six-yard box and Wellens diverted it into the corner.
Wellens should have scored again when he headed straight at Rhys Evans, but the home side did draw level 19 minutes from time when Liddell chased a long ball, fired against the bar from 20 yards and reacted smartly to follow up and beat the keeper from 10 yards.
Oldham almost completed a stunning fight back on 85 minutes when Paul Warne's shot was deflected against the woodwork by Andy Nicholas.