Shaun Whalley's dramatic injury-time free-kick rescued relegation-threatened Accrington against Rovers.
Richard Walker had put the Pirates ahead in the 58th minute, heading home a Craig Disley cross, and Aaron Lescott hit the post soon afterwards.
But substitute Whalley fired home through a crowd of bodies with Stanley's first real chance.
To add to Rovers' woes Stuart Campbell was shown a red card for violent conduct with seconds remaining.
Accrington Stanley: Kazimierczak, Richardson, Edwards, Williams, Almeida (Brown 76), Todd, Boco (Whalley 72), Proctor, Harris, Mullin, Mangan.
Subs Not Used: Doherty, Rogers, Cavanagh.
Booked: Harris, Edwards.
Goals: Whalley 90.
Bristol Rovers: Phillips, Lescott, Oji, Elliott, Carruthers, Igoe, Campbell, Disley, Haldane, Lambert, Walker (Nicholson 67).
Subs Not Used: Mike Green, Sandell, Lines, Jacobson.
Sent Off: Campbell (90).
Booked: Lescott, Oji.
Goals: Walker 58.
Att: 1,302.
Ref: M Jones (Mansfield).