Burnley boss Owen Coyle had a horror night as last year's semi-finalists crashed out of the League Cup and lost striker Martin Paterson and keeper Brian Jensen to injury.
Coyle's hopes for another impressive cup run were shattered, but more worryingly an extended absence of Paterson and giant Dane Jensen - a hero of their Premier League campaign so far - could hamper their league ambitions.
Coyle could only watch in horror as first Paterson crashed down with no one near him and then giant Dane Jensen clashed with Barnsley centre-back Darren Moore.
Worryingly Jensen stayed down for several minutes before being carried off after 34 minutes.
Burnley might have been even further hampered when already booked defender Richard Eckersley escaped with a lengthy telling off after he dragged down Adam Hammill for the second time.
Coyle had made six changes but still fielded a strong side and it showed.
Only a timely block by home defender Moore shut out livewire winger Fernando Guerrero, who made a blistering break from halfway before rounding it off with a low shot.
Then Rob Kozluk made a last-ditch intervention on the line to shut out Steven Fletcher after a pinpoint cross from Chris Eagles.
Burnley deservedly went ahead after 21 minutes. Jensen's long clearance was cleverly controlled by Fletcher on his chest before he spun neatly, shrugged off Moore and drilled in an accurate shot from 20 yards.
Less than a minute later Barnsley, who are third from bottom of the Championship, levelled with only their second attack.
And Burnley went behind in the sixth minute of a scheduled eight extra minutes at half-time.
Hammill went on a mazy run and failed to pick out Iain Hume, but the ball ran to Anderson Silva who slammed in a sensational 25-yard shot.
Seven minutes after the restart, Guerrero tore in again and slid the ball in for Eagles to finish crisply to level the score.
But 15 minutes from the end Barnsley went in front when Hugo Colace headed home Silva's pinpoint cross and the Championship club successfully played out time for a morale-boosting victory.