Swindon midfielder Grant Smith struck a second-half double to take all three points from third-placed Tranmere.
After trailing to a first-half Ryan Taylor strike, Swindon failed to register a shot on target before a Smith quick-fire double stunned the visitors.
Smith smashed in a free-kick on 57 minutes before hitting a winner just 90 seconds later.
Despite their defeat Tranmere booked their place in the end of the season play-offs as other results went their way.
Tranmere looked in total control in the first half, and after top scorer Iain Hume saw a shot go wide, Taylor smashed in a free-kick on 20 minutes to give the visitors the lead.
Swindon striker Christian Roberts struck the Tranmere crossbar and strike partner Rory Fallon miscued as the home side pressed for an equaliser.
After the break Swindon showed more passion and stunned Tranmere with two goals in two minutes.
Eugene Dadi was brought down and Smith stepped up to equalise from a free-kick.
And seconds later Fallon played in Smith who coolly shot home to give Swindon the lead.
Tranmere went in search of an equaliser of their own and Hume almost grabbed one just before the end when he connected with a long throw from Taylor but his effort drifted just the wrong side of the post.
Tranmere defender Ian Goodison poked an effort wide before Swindon blew two good chances
First Roberts broke clear of the Tranmere defence only to shoot wide then another free-kick from Smith almost grabbed an unlikely hat-trick for the midfielder.