Wrexham rose to second in League One after extending their unbeaten league run to eight matches with a 2-1 victory over Wigan Athletic at the Stok Racecourse.
The Latics controlled proceedings early on without overly troubling the hosts who saw Paul Mullin fire a free-kick at Sam Tickle in an opening half of precious little goalmouth action.
After surviving a scare from a Jensen Weir effort moments earlier, the hosts took the lead as Ryan Barnett's deflected strike beat Tickle.
Manchester United loanee Joe Hugill looked to have earned Shaun Maloney's side a point in north Wales when he headed Silko-Amari Thomas' cross beyond Mark Howard on 79 minutes.
But Steven Fletcher struck his third goal in four matches in the first minute of added time as Wrexham - who remain unbeaten on home turf in the league this term - sealed a dramatic victory.
Phil Parkinson's side sit one point clear of Wycombe Wanderers following the Chairboys' 2-1 defeat at Charlton Athletic and one behind leaders Birmingham City - who have two games in hand.
Wigan drop to 16th after a ninth league loss of the campaign.
Wrexham boss Phil Parkinson:
"They're [Wigan] a good side, we knew that. They've got some dangerous players. Where we at our best? Probably not.
"In terms of sticking to the job and showing character, strength and personality, I think all of that was high.
"The mentality of the group is so strong, and that showed again today."
Wigan Athletic head coach Shaun Maloney:
"I can't say anything negative about the team. I think there were moments in both boxes that you can probably pick out, but the team were brilliant today.
"They're [Wrexham] just really dangerous with the long ball, you know their nines are going to cause a threat.
"I thought we were really good. Honestly, I can't ask any more of them. You never want to accept getting beat, but if there's ever a way you do, it's playing like that."