Match ends, Derby County 2, Barnsley 1.
Derby revived their play-off hopes by fighting back to beat Barnsley for their first win in seven games.
The visitors went ahead when the Rams failed to deal with Marc Roberts' long throw and on-loan midfielder Matty James headed home.
The lead lasted only two minutes as Tom Ince fired into the net after Barnsley's defence failed to clear.
Ince then hit the post before David Nugent struck with the help of a deflection - his first goal for Derby.
The three points lifted Steve McClaren's Rams, who had lost three of the previous four games, above their opponents into 10th place in the Championship table - but 10 points adrift of Sheffield Wednesday in sixth.
It took the hosts half an hour to muster a shot on goal as Paul Heckingbottom's Tykes made a lively start with striker Adam Armstrong, in particular, threatening an early breakthrough.
The home team put their sluggish opening behind them as Johnny Russell and Julien de Sart tested goalkeeper Adam Davies, but they paid the price for poor marking when James nodded into the corner after the break. It was his first goal since scoring for parent club Leicester in a 2-2 draw with Watford more than three years ago.
Ince pounced for the equaliser as Barnsley's defence failed to deal with a ball into the box, but although Davies tipped over from Russell's curler, he could do nothing with Nugent's effort which wrongfooted him after hitting defender Angus MacDonald.
Derby boss Steve McClaren: "It's a big win for us and I have to say it was fantastic character from 1-0 down from a long throw and everyone could have gone down.
"It was important to react quickly which we did and then it was quite an open game, but we got the goal and then hung on at the end.
"It's one game at a time, I hate losing and I've been angry in the last couple of weeks. It's not a pleasant taste and we talked about finding a way to win today.
"Two defeats put us back in terms of confidence and we're now just trying to build confidence."
Barnsley head coach Paul Heckingbottom: "The players are an honest bunch and they are disappointed with the two goals we have conceded.
"I'm disappointed with a few performances in that we weren't positive enough and didn't have a big enough effect on the game to make us win it.
"If you think you are conceding sloppy goals and some of your players aren't at their best, the fact we've lost 2-1 and could have got something out of the game shows how far we've come.
"I'm generally not bad at getting the result in perspective, good or bad, but I feel a bit thrown today from the feedback I'm getting from other people and how I feel about the game."
- 7RussellSubstituted forHughesat 79'minutes
- 17de SartSubstituted forButterfieldat 45'minutes
- 23VydraSubstituted forAnyaat 84'minutes
- 28NugentBooked at 90mins
- 17YiadomBooked at 27mins
- 6ScowenBooked at 58minsSubstituted forLeeat 87'minutes
- 20BradshawSubstituted forKentat 75'minutes
- 32A ArmstrongSubstituted forMowattat 75'minutes
- Keith Stroud
- Shots on Target
Second Half ends, Derby County 2, Barnsley 1.
Jacob Butterfield (Derby County) wins a free kick in the defensive half.
Foul by Ryan Kent (Barnsley).
Attempt saved. Ryan Kent (Barnsley) right footed shot from the right side of the box is saved in the top right corner. Assisted by Angus MacDonald.
David Nugent (Derby County) is shown the yellow card.
Foul by Alex Pearce (Derby County).
Marley Watkins (Barnsley) wins a free kick in the defensive half.
Attempt saved. Will Hughes (Derby County) right footed shot from the centre of the box is saved in the centre of the goal. Assisted by Jacob Butterfield.
Alex Pearce (Derby County) wins a free kick in the defensive half.
Foul by Marley Watkins (Barnsley).
Attempt missed. Bradley Johnson (Derby County) header from the centre of the box is just a bit too high. Assisted by Tom Ince following a corner.
Attempt blocked. Tom Ince (Derby County) left footed shot from the right side of the box is blocked. Assisted by Cyrus Christie.
Corner, Derby County. Conceded by Marc Roberts.
Markus Olsson (Derby County) wins a free kick in the defensive half.
Foul by Ryan Kent (Barnsley).
Dangerous play by Bradley Johnson (Derby County).
Andy Yiadom (Barnsley) wins a free kick in the defensive half.
Substitution, Barnsley. Elliot Lee replaces Josh Scowen.
Corner, Derby County. Conceded by Angus MacDonald.