Championship strugglers Ipswich netted five second-half goals in a stunning comeback to end the four-match winning streak of play-off hopefuls Barnsley.
Craig Davies's early penalty and a Ricardo Vaz Te header put the Tykes into a commanding half-time lead.
But Ipswich midfielder Keith Andrews silenced Oakwell with two goals within four minutes of the restart to level.
Danny Collins, Michael Chopra and Jason Scotland left Barnsley shell-shocked before Davies grabbed a late third.
It was a vital victory for Paul Jewell's men, who were level on points with third-bottom Nottingham Forest before the late-kick-off.
A shocking run of seven straight defeats had seen Ipswich, who Jewell insists are still gelling after he made 13 summer signings, plummet towards the relegation zone.
In contrast Barnsley have rapidly climbed a tight league table with five wins in six games to leave Tykes fans dreaming of an unlikely play-off spot.
And it seemed Keith Hill's side were on their way to moving up to seventh place, just two points behind Yorkshire rivals Leeds United, after a dominant first-half display.
They took the lead from the spot after Danny Drinkwater was brought down by David Stockdale and Davies stepped up to send the England goalkeeper the wrong way on 13 minutes.
They doubled their lead when Vaz Te rushed to the near post to meet a Butterfield corner with a diving header.
Ipswich got back into the game in the first 20 seconds of the second half when Andrews unleashed an unstoppable volley into the bottom corner of the net.
And they levelled moments later as Andrews powered home Aaron Cresswell's cross with his head.
They completed a remarkable comeback when Collins rose highest to head in Lee Martin's corner and went further ahead a minute later as Chopra buried his effort in off a post.
Cresswell's inviting cross was slotted into the corner by an unmarked Scotland for the fifth, before Davies added a consolation by curling in a wonderful 25-yard free-kick.