Simon Cox's superb second-half double secured all three points for Swindon and dealt Oldham's play-off hopes a massive blow.
The emphatic victory was only Swindon's first win in the last 11 games and should secure League One football for them next season.
Striker Cox should have opened the scoring in the fourth minute when he latched on to goalkeeper Petr Brezovan's long clearance.
Cox was free 25 yards from goal but put his shot well wide of the right-hand post.
Oldham missed their own golden opportunity on the half-hour mark through midfielder Chris Taylor. Right-back Neal Eardley picked out Taylor six yards from goal unmarked at the back post but he somehow managed to slice the ball wide with the gaping goal at his mercy.
Swindon opened the scoring four minutes after the break through Lee Peacock's sixth goal of the season. Left-winger Anthony McNamee went on a mazy run into the penalty area before picking out Peacock who finished from four yards.
McNamee almost added his second two minutes later but his drilled effort from 18 yards went just over the bar.
Swindon's fine play got its reward in the 53rd minute when they added a second goal. McNamee was again the provider as his cross picked out Cox and the top scorer made no mistake with his shot from 12 yards.
Swindon finished the game as a contest with Cox's 12th goal of the season with 20 minutes left. Peacock linked up well with Cox who then turned and rifled the ball home from 22 yards.
Jerel Ifil almost added a fourth for Swindon in the 78th minute but his header from a corner went a yard wide of the right-hand post.