REPORT: Wigan Athletic 3 Swindon 4
Wigan Athletic's hopes of closing the campaign with a win were scuppered by the ridiculous sending-off of Curtis Tilt, followed by three late goals from already-relegated Swindon.
Latics were in total control midway through the second period, leading 3-1 and looking like scoring every time they went forward.
But referee Graham Salisbury - officiating in his 588th and final EFL match - took centre-stage by dismissing Tilt following an innocuous tangle with Tyler Smith as the pair chased a long goal-kick.
And after that it all went downhill fast, with the visitors hauling themselves level by the 90-minute mark - and then winning it three minutes into added time.
Latics, of course, had already achieved their seasonal goal of staying up, against all the odds.
But as boss Leam Richardson acknowledged after the game, they had been left with a bitter taste in the mouth at the way things ended.
Boosted with the confidence of having secured their safety with a game to spare, Latics flew into their opponents from the off.After forcing six corners inside the opening four minutes, they were screaming for a penalty when a driving run into the box from Callum Lang saw the forward appear to be taken out after sliding the ball beyond the advancing goalkeeper.
Swindon defender Jonathan Grounds managed to get back to clear off line despite a lunge from Joe Dodoo, with the official ignoring the penalty shout.
Latics didn't have to wait long for the opening goal, however, with their seventh corner being sent over from Dan Gardner and nodded in from close range by Tilt - playing his last game before returning to parent club Rotherham.
Swindon took until midway through the first period to show themselves as an attacking unit, but Twine was unable to hit the target from a good position.
Latics created and squandered a couple of decent opportunities to double their advantage, both of them falling to Dodoo.
But the big man fired over when he had time and space to pick his spot from 12 yards, before swivelling and volleying the ball inches wide of the far post.
Zach Clough, making his first start in three months, sent a free-kick flashing just past the post from the edge of the box, but Latics were very good value for their interval lead.
The home side were indebted to Tilt for making a fantastic block at the start of the second stanza when Twine pulled the trigger from 15 yards.
But Latics notched the second goal their superiority undoubtedly warranted 11 minutes after the restart, with Clough teeing up Will Keane, who slotted the ball home with an effortless swing of his right foot.
Swindon pulled one back within three minutes, though, when a free-kick from Twine - by far their biggest threat all afternoon - fizzed over the wall and into the top corner from 25 yards.
But Latics took less than a minute to regain their two-goal advantage, with Keane's volley from just inside the box being flicked home by Clough for his first Latics goal.
It was almost 4-1 when a Luke Robinson cross was met by a looping header from Lang, who watched as the ball beat the goalkeeper only to bounce off the bar on the way over.
With Latics in total control, it seemed only a matter of time before the home side added to their tally, with the visitors looking a very dispirited bunch.
But referee Salisbury had other ideas, deciding - for sons known only to himself - to brandish a straight red card for Tilt for an innocuous tangle with Smith 30 yards from goal.
Swindon took advantage 13 minutes from time when Hallam Hope raced clean through and slid the ball under Jones.
Latics saw their lead slip away with 90 minutes on the clock, when Smith headed home from close range.
And there was worse to come in added time, when Twine lashed home his second goal to steal the points.
Get 20% off our sports subscription package and stay up to date with all the latest Wigan Athletic news with a year’s subscription to WiganToday for less than 9p a day. Use promo code TRANSFER20