Scott Wootton’s injury-time volley earned Wigan a 2-1 League One victory at the Memorial Stadium and made it a losing start for new Bristol Rovers boss Joey Barton.
The visitors took a 52nd-minute lead when Will Keane nodded on a left-wing corner from Luke Robinson for Callum Lang to head in his fourth goal in five games at the far post.
But Luke McCormick levelled in the 69th minute, racing on to a Brandon Hanlan pass and cutting in from the left to bury a low right-footed drive from 12 yards.
The match was deep into stoppage time when Rovers failed to defend a free-kick into their box and Wootton was allowed space to connect with a sweet strike at the near post.
It meant that Barton’s first game as Rovers boss ended with his new club in the relegation zone.
His side had made a bright start, with Hanlan and Alex Rodman going close with headers.
But Wigan gradually gained a foothold and secured a win that takes them level on 27 points with their hosts and just one point adrift of AFC Wimbledon in 20th.