Newly promoted Halifax Town saw off 10-man Wrexham at home to claim their first Conference Premier win.
Simon Ainge's own goal gifted Wrexham the lead but Lois Maynard replied with a header from a rebound off the bar.
Wrexham defender Stephen Wright was sent-off for bringing down Adam Smith and Josh Wilson converted the penalty.
Lee Gregory struck a third after Joslain Mayebi saved his initial shot and Halifax held on, despite Adrian Cieslewicz pulling a late goal back.
VIEW FROM THE DRESSING ROOM
Wrexham player-manager Andy Morrell told BBC Radio Wales:
"We needed to get through to half-time 2-1, but I can't believe how good we were in the second half.
"We played into their hands too much in the first half... in the second half when we started passing it and moving it and playing it, even with 10 men I thought we absolutely battered them.
"The chances we had were unbelievable and I'm absolutely gutted for them, because the amount of effort they put in and the chances they created I can't believe we haven't got something out of it."