Midfielder Martin Smith produced a stunning late goal to give Huddersfield renewed hope as they battle to avoid relegation from the second division.
Smith provided the vital break just four minutes from the final whistle as he fired home his seventeenth goal of the season and earned Huddersfield an invaluably second successive victory.
The midfielder still had plenty to do after captain Andy Booth had headed Chris Holland's cross in to his path but he had no hesitation in unleashing an unstoppable left foot shot which flew past Swindon goal keeper Bart Griemink in to the top right hand corner.
Huddersfield have only four games left to preserve their second division status and face a tough game against leaders Wigan next week but manager Mel Machin could not hide his delight at the end.
Machin, who has only been in charge for three weeks, said: "This is a great win for us and it was a real team effort.
"It was a fantastic goal to win the match and the lads had to show a lot of character because we were made to battle at times, especially in the second half." But Huddersfield were restricted to long range efforts on the whole and Swindon only had themselves to blame for not taking at least a share of the points after wasting a series of clear cut chance.
Australian winger Danny Invincibile produced the miss of the first half in the 36th minute when he found himself unmarked at the far post but somehow headed over from just six yards out.
Midfielder Darren Dykeswas unlucky not to celebrate his full league debut with a goal on 56 minutes when his looping effort from the edge of the area had goal keeper Philip Senior beaten but cannoned off the cross bar to safety.
Swindon continued to enjoy the bulk of possession and should have finally taken the lead in the 84th minute but Steve Robinson blazed over when in the clear ten yards out and he was made to pay as Smith grabbed the winner two minutes later.
Angry Swindon boss Andy King said: "that performance was just not good enough and I have told the players so in the dressing room.
"It was a very very poor display, we missed some good chances and to make matters worse we then conceded a very poor goal at the end. I'm very disappointed."