Marc Roberts scored a last-minute winner as League One Barnsley left it late to beat National League York 3-2 in the first round of the FA Cup.
Roberts added to Davis Keillor-Dunn’s double after York, who had led through Josh Stones, thought Mark Kitching had forced extra time.
Stones gave the Minstermen a deserved lead in the 23rd minute as his header looped over Murphy Cooper in the Barnsley goal, sending the away end wild.
The hosts levelled seven minutes later as Jamaica international Jon Russell found space in the box before laying off to Keillor-Dunn who made no mistake to score his seventh goal of the campaign.
Keillor-Dunn gave Barnsley the lead in the 77th minute as he smartly turned home from inside the area after being found by Neil Farrugia.
Kitching blasted the ball into the roof of the net to level the game for York in the 87th minute after Alex Newby’s free-kick was parried away by the Barnsley goalkeeper.
But the National League side were denied extra time in the first minute of added on time after Roberts climbed highest to head in a Luca Connell corner.