Substitute Adam Phillips scored the winner as Barnsley came from behind to beat local rivals Rotherham United and book the League One club's place in the Carabao Cup third round.
Ar'jany Martha gave the Millers the lead as they threatened to secure a first victory over Barnsley in 14 attempts - a run stretching back to October 1982.
But the hosts' second-half fightback was ignited by an equaliser from Jon Russell just before the hour mark and completed 10 minutes later by Phillips' second goal of the season.
Victory delivered safe passage for Barnsley into the third round for the second consecutive season, with hopes high at Oakwell for a better showing than the 7-0 beating they suffered at the hands of Manchester United at Old Trafford last season.
For Rotherham, this was a fourth consecutive second-round exit in this competition and they will wonder what they have to do to get a break against Barnsley.
Matt Hamshaw's side were denied by a fine save from keeper Murphy Cooper at the feet of Shaun McWilliam with 10 minutes on the clock - and Barnsley then needed goal-line clearances by Connor Barrratt and Jack Shepherd to keep them out.
Martha's goal on 19 minutes, cutting in from the left flank and firing a low shot inside Murphy's right-hand post for his first goal in a Millers shirt, delivered a deserved lead.
But when McWilliams was again denied by Murphy 10 minutes into the second period, this time with a stunning save to tip the ball away from the top-right corner, alarm bells might well have started to ring in the away dugout.
Russell had missed an easier chance towards the end of the second half, but produced a deft finish to sweep home Nathanial Ogbeta's left-sided delivery just four minutes after Murphy's heroics.
Martha thought he had restored the Millers' lead on 66 minutes but tapped in at the far post from an offside position, and three minutes later Rotherham were behind.
Caylan Vickers' shot from the left was only partially dealt with by Cameron Dawson and second-half substitute Phillips kept his cool six yards out to finish Neil Farrugia's calm cut-back from the right.