Striker Paul Hayes snatched a dramatic winner against his old club four minutes into stoppage time as Scunthorpe United edged out Barnsley 2-1 at Glanford Park.
It earned the Iron three precious points in their fight to stay clear of the relegation zone after three successive defeats.
And it dragged Barnsley further back towards the danger area after a third defeat on the trot for them.
The two teams cancelled each other out in a stalemate first half of few real chances.
Midfield man Filipe Teixeira was the danger man for the visitors and he did go close with a shot from the edge of the box that whistled just over.
Scunthorpe leading marksman Gary Hooper found a couple of openings, but the first produced a poor finish and the second saw a shot on the turn from the edge of the box flash just wide.
The nearest Scunthorpe came to a goal came when winger Martyn Woolford rifled over from 20 yards after keeper Luke Steele had only half punched clear a free-kick into the box from Josh Wright.
But it was the home side who finally broke the deadlock in the 50th minute when Matt Sparrow drove in a low cross from the right which Hooper touched home from close range for his 11th goal of the season.
That pepped Scunthorpe up and they went close again when Hooper set up Woolford for a shot which flashed across the face of the goal.
With an hour gone, Hooper had a chance to give his side extra breathing space when he broke clear through the middle, but was denied by a good save from Steele.
The Barnsley keeper was quickly in action again, going full stretch to turn away a shot from Hayes.
After a spell under real pressure, the Tykes should have been back on level terms when Anderson De Silva, unmarked at the far post, headed wide with the goal at his mercy from a good cross by full-back Bobby Hassell.
Barnsley did snatch an equaliser after 79 minutes when a mistake by Scunthorpe skipper Rob Jones let in substitute Daniel Bogdanovic to squeeze an angled shot past keeper Joe Murphy.
It looked set to earn them a point until deep into stoppage time when Hayes curled a shot into the far corner past the outstretched Steele.