A late goal was enough to give a resurgent Aldershot Town all three points against York City at the Recreation Ground.
Substitute Darren Barnard scored the winner with two minutes left when he struck a powerful drive past York keeper Chris Porter after a free-kick had been awarded on the edge of the penalty area for a foul on Gary Holloway.
Earlier Clayton Donaldson's equaliser for York had cancelled out Nick Crittenden's early opener.
Aldershot started the match brightly and took a deserved lead midway through the first half. Referee Fred Graham ordered an Aldershot free-kick to be retaken just outside the area, after Mark Convery had moved forward from the York wall before the free-kick was taken.
Crittenden promptly stepped up and struck a low curling shot into the bottom left-hand corner of Porter's goal.
York were quiet with their only real chance of the first period coming ten minutes before half-time but Donaldson could only head Darren Dunning's cross into the arms of Shots keeper Nikki Bull.
The second half saw the game open up as York pressed forward in search of an equaliser and they were rewarded in the 65th minute when Andy Bishop's pass put Donaldson through on goal.
The York striker skipped passed keeper Bull and coolly dispatched the ball into the net from a tight angle. Both teams had chances to score again in the last 20 minutes before Barnard's free-kick earned Aldershot the three points.
Crittenden went close for the hosts with a mazy run that ended with a powerful shot that was parried by Porter and ten minutes from time Donaldson's clever back-heel set up Bryan Stewart who raced into the Aldershot penalty area but Bull saved well at his feet.