A superb late goal from the returning Adam Hammill ended a run of six successive losses and put Barnsley into the Northern semi-finals of the Johnstone's Paint Trophy with victory over York City on Tuesday.

Hammill, who re-signed for the Reds the previous day after starring for them between 2009 and 2011, netted six minutes from time to cap an excellent individual performance.

Ex-Red Michael Coulson opened the scoring for York just before the break with a sensational free-kick but Ben Pearson levelled from a yard out midway through the second half before Hammill's winner.

Head coach Lee Johnson made four changes from the FA Cup loss at Altrincham on Saturday which piled on extra misery after seven successive League One defeats left them in the relegation zone.

Hammill and fellow Monday signing Ivan Toney both started while Conor Hourihane and Lloyd Isgrove returned after injury and Simeon Jackson was put back in.

Marley Watkins was suspended and Josh Scowen injured while Sam Winnall and Marc Roberts were dropped to the bench and George Maris left out.

Toney and Jackson played up front with Hourihane partnering Pearson in central midfield while Hammill was on the left and Isgrove on the right.

Toney fired a low 25-yard shot just wide then Isgrove's effort from a similar distance was too close to former Barnsley goalkeeper Scott Flinders. Isgrove then hit the bar with a sliced cross from the right as the Reds dominated the first 20 minutes.

But York came back into it with Ben Godfrey and Coulson testing home goalkeeper Adam Davies from just outside the box.Coulson gave the visitors the lead in the 40th minute with a stupendous 30-yard free-kick into the top right corner.

Barnsley almost levelled before the break as Flinders denied Isgrove from close range then saved easily from Hammill after some good skill and caught a bicycle kick by Toney.

The second half started more quietly but the Reds levelled on 68 minutes when the Hammill's cross from the left went over Flinders and was bundled home by Pearson almost on the line.

Both sides then went extremely close with Davies denying Vadaine Oliver from point blank range then Isgrove firing wide eight yards out after another Hammill cross.

Hammill then made it 2-1 late on when he cut in from the left past a defender and curled the ball into the top right corner from just inside the box.

Isgrove then put another fantastic chance wide after bursting through the York defence but Barnsley had done enough to win.