It was Swindon's first visit to Fratton Park for over 12 years.
Swindon piled on the presure throughout the first half, and took the lead just before half time on 45 minutes when Matt Richie scored against his old club.
Ten minutes after starting the second half Andy Williams scored his first goal for Swindon from a tight angle to make it 2-0.
As the game progressed Portsmouth came back into the game, and did score 2 minutes into the 4 minutes of stoppage time with a goal from Michalik. Pompey had hit the bar and post in the minutes before scoring as well, but Swindon held out to win, which moves them back up to 8th in the table.