Swindon kept up their promotion chase thanks to goals from Lucas Jutkiewicz and Curtis Weston.
Rovers took a shock lead in the 12th minute from Richard Walker picked up his keeper's goal-kick and slid the ball past Phil Smith.
But Jutkiewicz equalised three minutes later after a defensive error and Curtis Weston put Swindon ahead with a fantastic 30-yard strike.
Rovers sub Andy Sandell wasted a chance to equalise, heading a free-kick wide.
Swindon: Phil Smith, Jack Smith, Vincent, Ifil, Williams, Brown (Peacock 68), Weston (Shakes 81), Timlin, Zaaboub, Roberts (Nicholas 89), Jutkiewicz.
Subs Not Used: Stewart, Pook.
Booked: Roberts, Timlin, Jack Smith.
Goals: Jutkiewicz 15, Brown 17.
Bristol Rovers: Phillips, Lescott (Ryan Green 83), Carruthers, Hinton, Elliott, Igoe, Disley (Lambert 63), Campbell, Haldane (Sandell 58), Walker, Nicholson.
Subs Not Used: Mike Green, Lines.
Booked: Campbell, Haldane, Igoe.
Goals: Walker 12.
Att: 10,010.
Ref: J Singh (Middlesex).