© PA Photos
The Villans were in control of the game right from the start and went close on 12 minutes when Barry Bannan's shot from outside the area went just wide.
Villa went ahead on the half-hour mark when Christian Benteke headed home from close range.
Bannan tried to make it 3-1 to Villa on 62 minutes but his shot was blocked by Joe Devera.
Swindon halved the deficit in the 78th minute when Miles Storey sidefooted a cross home, and the 18-year-old scored the equaliser three minutes later when he found the target with a cheeky backheel.
There was more drama to come at the County Ground, as Andreas Weimann's shot clipped the post for Villa late in the match.
Then in the dying moments Villa scored their third and winning goal, Benteke finding the target from inside the area.