Conor Thomas struck deep into injury-time to hand Millwall their first Sky Bet League One defeat for 17 games on Saturday afternoon.
In a game of few chances, Thomas took advantage of a deflection in the 94th minute to secure all three points for The Robins.
Millwall boss Neil Harris made one change from Tuesday night's 3-3 draw at Rochdale, with Mahlon Romeo replacing Shaun Cummings at right-back.
The opening exchanges saw attempts on goal few and far between, with Lee Gregory's half-chance the only shot of note.
In the 22nd minute, Jordan Archer was called into action for the first time, tipping Johnny Goddard's shot around the post, whilst two minutes later, Shaun Williams fired over as a drab first-half tried to ignite.
Four minutes before half-time, Gregory found his way into the Swindon penalty area, but found a swarm of Robins defenders in his way of an attempt on goal.
Charlie Colkett forced Archer into a save shortly before the 45-minute mark in the last action of the half.
Nathan Thompson had the first shot of the second-half on 50 minutes, but his tame effort was comfortably held by Archer.
Harris introduced Fred Onyedinma into the game on 56 minutes as The Lions looked for a different option, but it was Archer that was required at the other end moments later, palming away Jon Obika's deflected drive.
The manager's second substitution saw Shane Ferguson replace Steve Morison on 71 minutes - a move that saw Onyedinma push further forward alongside Gregory.
Good play between Onyedinma and Ferguson saw the former presented with the opportunity to open the scoring three minutes from time, but the forward could not guide his effort towards goal.
In injury time, The Robins took the lead. A deflected shot found its way to Connor Thomas, who steered home past Archer.
Referee John Busby blew his whistle shortly after on a first League defeat for The Lions since a 3-0 reverse at Scunthorpe United on 17th December.
Swindon Town: Vigouroux, Thompson (Barry, 89'), Thomas, Obika, Goddard (Norris, 70'), Ajose, Colkett, Dabo (Brophy, 70'), Ince, Conroy, Rossi-Branco. Subs not used: Henry, Jones, Kasim, Starkey.
Bookings: Thompson, Conroy
Scorer: Thomas (90+4')
Millwall: Archer, Craig, Williams, Gregory, Romeo, Wallace, Butcher, Webster, Morison (Ferguson, 71'), O'Brien (Onyedinma, 56'), Cooper. Subs not used: King, Cummings, Hutchinson, Worrall, Thompson.
Bookings: Gregory, Butcher
Referee: John Busby