Jordan Edwards opened the scoring for the hosts with a flying header but the Glovers equalised when Jeremiah Gyebi smashed home Gabriel Rogers’ corner from close range.
Swindon controversially restored their lead just before half-time.
Young goalkeeper Charlie Philpott was clattered in the build-up and despite his and right-back Charlie Fripp’s best efforts to keep the ball out, Luke Haines squirmed the ball an inch over the line.
Nestor Shako had two good chances to draw Town level but couldn’t convert, and then Gabriel Rogers hit the bar with a shot from distance in the second half.
The hosts added to their advantage through a sweetly struck Edwards volley and although Harry Haughton set up an exciting finale with a low strike from 20 yards, Swindon held on for three points.