Junior Agogo was sent off the bench with 20 minutes to go to secure Rovers League future.
He did so with an expert cross shot beyond Swansea keeper Roger Freestone and then to celebrate smashed another shot against an upright.
Swansea had seen an early lead given them by Paul Connor wiped out by a 31st-minute strike by Graham Hyde as Rovers came back at them.
Agogo, who made the goal for himself from a throw in, has now scored three times for caretaker bosses Russell Osman/Kevan Broadhurst.
He had been held back on the bench because of a slight injury picked up in training.
Osman said: "We nearly started with him to see how long he would go but decided in the end to give two other players we have brought in their chance." Lee Thorpe and Bo Henriksen threw everything at Swansea but were finally replaced in the closing stages.
Swansea always driven on by their hard working skipper Roberto Martinez were disappointed at going down to a fifth successive defeat.
"This is the third match in a row we've gone down to a late goal and we scored first in two of them." said manager Kenny Jackett.
"We have given away too many goals but I must credit Agogo with the one he scored for Rovers - he created it for himself out of nothing." Although City's top scorer Lee Trundle has lost his scoring art of recent months he was the goal provider when he slid a pass forward to Connor after just seven minutes.
Holding off a challenge from Rovers' captain Adam Barrett, a £35,000 buy from Rochdale, scored an impressive goal which put Swansea well on top.
It was Henriksen's cross from the right which set up the chance for Hyde to put Rovers level. From then on chances were evenly divided from the midfield area but Swansea failed to get many shots on target.