Iain Hume grabbed late winner to throw Leicester City a lifeline and drag Barnsley back into the relegation mix.
This basement clash looked to be stumbling towards a goalless stalemate until Hume struck with a vital effort after 72 minutes
A win for Barnsley would have sealed their survival, but they were twice denied by the woodwork as they came close to claiming the win.
Ian Holloway's Leicester side - backed by nearly 4,000 travelling fans - claimed huge slices of possession but failed to produce an effort on target until Hume pounced
Substitute Barry Hayles cleverly held off Lewin Nyatanga in the area and slipped an inviting ball for Hume, who coolly finished off by slotting the ball in from two yards.
It spared the blushes of Patrick Kisnorbo who had wasted Leicester's best chance on 66 minutes after firing over from 10 yards.
Barnsley had looked more likely to produce a goal on the break. First Martin Devaney wriggled through two challenges before smashing a shot from 25 yards only to strike the right-hand post three minutes before half-time.
And when Stephen Foster's super cross deceived Richard Stearman, Diego Leon slammed his angle effort against the post from point blank range.
With both sides desperately scrapping for Championship survival they were anxious for the win, but on a wind-affected afternoon they were even keener not to lose.
The Foxes started off third from bottom and began with more urgency than Barnsley, who were within touching distance of ensuring second tier football next season.
But despite claiming most of the possession, Holloway's side failed to create an serious threats in the first half.
David Bell fired in a series of free-kicks and corners from the right aimed for Steve Howard, but Barnsley centre backs Dennis Souza and Nyatanga were impressive.
When Kisnorbo swung in a free-kick, Howard was wide of the target with his header and home keeper Luke Steele did well to block out IHume chasing a long ball forward.
But Barnsley were denied the lead by Paul Henderson's upright when Martin Devaney smashed a 25-yard effort that struck the right-hand post.
Leicester midfielder Lee Hendrie hobbled off just before break after a cynical tackle from Rob Kozluk that earned him a yellow card.
But Hume had the last word to send the travelling fans home happy.