It was a shame that such an enthralling tie should go to a penalty shoot-out, but on the balance of play Oldham deserved their victory and progress past Barnsley into the last eight of the Northern Section of the Johnstone’s Paint Trophy.
Oldham substitute Rhys Turner scored the decisive spot-kick after Sam Winnall and Kane Hemmings missed from 12 yards.
The Reds largely dominated second-half proceedings, but that was not enough to compensate for a sub-standard first-half showing in which they trailed 2-0 to goals from former Leeds United striker Dominic Poleon and in-form Danny Philliskirk.
The first-half scoreline could have been even greater were it not for the efforts of Ross Turnbull in the Reds goal. Three times in those opening 45 minutes he pulled off superb stops.
Whatever Danny Wilson said at the break seemed to work, and when the outstanding Luke Berry thundered the ball home from 25 yards, the comeback was on. Oldham could have scored three more times in a barnstorming second period, but the Reds weathered the storm to level matters in the last minute when Winnall lashed the ball high into the net fron 22 yards.
But then came the shoot-out and Oldham held their nerve.
Oldham Athletic: Rachubka, B Wilson, J Wilson, Mills, Dayton (Winchester 81), Jones, Tidser (Kelly 87), Philliskirk, Dieng, Poleon (Turner 79), Wilkinson. Unused substitutes: Coleman, Brown.
Barnsley: Turnbull, Brown, Berry, Dudgeon, Nyatanga, Williams (Cole 36), Treacey (Hemmings 54), Winnall, Hourihane, Bree, Bailey (Abbott 85). Unused substitutes: Davies, Ramage.
Referee: G Sutton (Lincolnshire).