An own goal from Kevin Amankwaah inside injury-time was enough to give Peterborough United all three points from a nine-goal thriller at London Road.
After going 3-0 down, goals from David Ball (2) and Matt Ritchie saw the Robins all-square at the break. Charlie Austin's penalty levelled in the second half after George Boyd had restored his side's lead. However the late, late own goal from Amankwaah left Town returning to Wiltshire with little to show for their considerable efforts.
Manager Danny Wilson kept faith with the same starting eleven that took all three points against Bristol Rovers on Monday night, with Paul Caddis included on the bench following his return from international duty.
The home side began the game with League 1 hotshots Aaron McClean, Craig Mackail-Smith and George Boyd all looking to fire the home side back to winning ways after last weekend's defeat at Hartlepool United.
Town made the worst possible start to the game, conceding twice in the opening five minutes. The first goal arrived with just three minutes on the clock with a cross from Mark Little finding Mackail-Smith unmarked inside the box and he headed into the corner past the despairing dive of David Lucas in the Town goal.
Just sixty seconds later and the home side doubled their lead. A through ball from George Boyd found Mackail-Smith on the edge of the box, with the striker sliding the ball under Lucas for his 11th goal of the campaign.
Despite the shock start, Town could did have chances inside the opening quarter of an hour with Matt Ritchie, Kevin Amankwaah and David Ball all coming close to reducing the early deficit.
Swindon's afternoon went from bad to worse on 22 minutes with Lee Frecklington netting his side's third. A poor clearance from Lucas found McLean on the edge of the box and his clever pass through found Frecklington with the midfielder finding the bottom corner.
Two minutes later and Town notched their first of the afternoon. A low cross into the box from the right from Kevin Amankwaah found David Ball just inside the box and after taking a touch inside his marker, the loanee's effort had the beating of Lewis.
Supporters had just four minutes to wait for the next goal of what was a frantic opening half hour. Matt Ritchie picked the ball up 25 yards from goal and without hesitation hit a thunderous effort which Lewis got a hand to, but couldn't prevent from rolling over the line.
Swindon were back on level terms thanks to a fine finish from David Ball. After Tommy Rowe had been caught in possession 40 yards from goal, Ball collected the loose ball before racing into the box and rounding Lewis for his second of the game.
After a spirited comeback, the Robins went into the half level with supporters left to reflect on a bizarre first half of League 1 action.
Danny Wilson made one change to the side at the interval, with David Lucas replaced by Phil Smith in goal.
Peterborough started the second half brightly and almost went back in front when George Boyd headed just wide two minutes in. It was Boyd who made the early breakthrough in the second period, firing home from close range just before the hour after a cross from the left was not dealt with by the Town backline.
Swindon came back strongly and had two chances in quick succession. First, Charlie Austin saw his downward header superbly saved by Lewis before Amankwaah headed over when unmarked from a corner.
Jonathan Douglas was forced off twenty minutes from time after a challenge from Lee Frecklington, with J-P McGovern taking over the captain's armband.
Two minutes later and Swindon were level. A handball from Charlie Lee inside the box saw Charlie Austin presented with a chance from the spot and the returning frontman made no mistake to make it 4-4.
The hammer blow for Swindon came in injury-time with Kevin Amankwaah turning a low cross into his own net to hand the home side the points after a topsy-turvy clash at London Road.