Wigan manager Leam Richardson could not hide his disappointment after a successful season for the club – including a takeover and safety – ended in defeat against Swindon.
The Latics had looked on course to continue their impressive recent sequence of results when they led 3-1 on the hour mark.
But the controversial dismissal of centre-back Curtis Tilt, for an innocuous tangle with Town forward Tyler Smith, turned the game on its head.
And the visitors were able to score three times in the last 13 minutes to edge a seven-goal thriller.
Hallam Hope made it 3-2 on 77 minutes, Smith equalised in the last minute, and Scott Twine popped up with a brilliant 25-yard strike three minutes into added time.
Tilt had earlier given Wigan the lead on 17 minutes with a fine header from Dan Gardner’s corner, with Will Keane doubling the advantage 11 minutes after the restart.
Twice had given Swindon hope on 59 minutes, but Zach Clough’s flick within a minute saw Wigan regain their two-goal lead – before the late drama.
“It’s disappointing, because you want to end the season on a real positive,” said Richardson.
“The club’s been taken over, we’ve managed to retain our League One status, and you’re hoping to round things off with a win for everyone connected to the club.
“We played well but we just didn’t have that cutting edge to put the game to bed when we were on top.
“The lads were enjoying themselves, and my message at half-time was that there was only one thing missing from the performance – and that was more goals.
“For all our dominance, for all our final-third entries, their goalkeeper didn’t really have to make that many saves.
“We started to do that at the start of the second half, and I thought we were good value for the 3-1 lead.
“And the game’s obviously changed on a sending-off, which I’ve not seen again myself, but I’m led to believe is very soft.
“We’re not so sure it was even a free-kick, and to see the red card come out, it’s hard to take.
“Even from there though, we can’t go to pieces like that, we can’t concede the goals we did, we can’t concede four goals at home.”
For Town goalkeeping coach Steve Mildenhall – sent out for media duties – it was a positive end to a hugely negative campaign.
“Look, any wins are good to have, on the last day of the season,” he said.
“For me, personally, it was very important for us to finish with a win.
“Yes, we know we were down, but one thing we didn’t want to do was come bottom of this league – which we haven’t.
“We’ve finished with a win and we’ve not finished bottom, but obviously we’re still very disappointed with where we are.
“It’s hard to put into words this year, and the things that have happened.
“What we can say is it’s been a very, very, very disappointing and frustrating season.”
The match was a fitting tribute to former Republic of Ireland midfielder Alan McLoughlin – who played for both clubs – following his recent death at the age of 54.
“As much as you can get down about football, when something like that happens, it does give you a perspective,” added Mildenhall.
“I was fortunate enough to know Macca for a long time, when I made my debut, he was playing for Portsmouth.
“It’s been a desperately difficult week for the club, and obviously for his family and especially his daughters.
“It was fitting today to have the minute’s applause, and the players wearing their armbands to show their respect.
“There isn’t enough time to adequately describe how good a person he was.”