Hat-trick hero Sam Parkin kept Swindon Town's play-off dreams alive as Wrexham were burried under a late goal rush.
The 22-goal striker turned the match on its head after Wrexham had pinched a two-goal first-half lead.
A third successive defeat loomed for Swindon when the Welshman scored twice in the opening half hour.
They opened up a hesitant Swindon defence in the 16th minute when Matt Crowell and Hector Sam combined to set up a 14th goal for Juan Ugarte.
The pair combined to stretch Wrexham's lead shortly afterward as Ugarte acrobatically crossed to Sam who finished well.
Swindon were at sixes and sevens, but shortly before half time they launched a remarkable comeback when Parkin headed the first of his three goals from a long throw by David Duke.
Wrexham, floundering in the relegation zone and stuck in administration, looked capable of holding on to their advantage but the game took a dramatic twist after Swindon boss Andy King threw on all of his three substitutes.
Swindon proceeded to score three times in a last quarter of an hour.
Parkin equalised after Steve Jenkins crossed from the right, then two minutes later Grant Smith put Swindon ahead with a ferocious free-kick.
Sam spurned a great chance of equalising but it was Parkin who had the final say when he completed his hat-trick with an injury-time penalty.