Michal Helik struck deep into stoppage time to help Barnsley come from behind to beat Huddersfield 2-1 at Oakwell.
The Terriers went ahead inside the opening quarter of an hour with a goal from Rarmani Edmonds-Green but the home side drew level eight minutes later through Helik.
Following a lively first half, there was little in the way of goalmouth action until Helik struck in time added on.
Callum Styles returned to Barnsley's starting line-up after suspension, replacing Clarke Oduor.
Huddersfield head coach Carlos Corberan, who was handed a contract extension along with his first-team coaching staff on Christmas Eve, named an unchanged side for the third game running.
Barnsley's Cauley Woodrow put an early header on target which was saved by Ryan Schofield at the foot of his left-hand post.
Schofield thwarted the same player a few minutes later, using his legs to keep Woodrow's shot out.
The visitors then took a 13th-minute lead when a short-corner routine led to Carel Eiting delivering a cross which was headed beyond Jack Walton by Edmonds-Green.
There was a chance soon afterwards for Fraizer Campbell to put Huddersfield further ahead as he latched onto a ball from Jonathan Hogg but with Walton advancing towards the edge of his area, the striker put his low shot wide.
The equaliser came eight minutes later when Woodrow did well to keep the ball in play from a Matty James cross and Helik headed home.
In the latter stages of the half, Huddersfield's Juninho Bacuna shot wide and Woodrow had an effort deflected off target.
Soon after the re-start, Bacuna's cross was just too high for Edmonds-Green.
Barnsley head coach Valerien Ismael made a change on the hour mark with Victor Adeboyejo replacing Dominik Frieser, with Alex Pritchard taking over from Eiting for Huddersfield shortly afterwards.
Schofield then made a fine reaction save to keep out Adeboyejo's overhead kick.
There was a double change for the hosts a few minutes later with Herbie Kane and Luke Thomas coming on in place of James and Conor Chaplin.
A further change for Huddersfield saw Isaac Mbenza make way for Adama Diakhaby.
There was another double switch for the Tykes a few minutes from time with George Miller and Romal Palmer replacing Woodrow and Alex Mowatt.
But drama followed as Helik grabbed the winner in the fourth minute of time added on, firing into the net after a long throw was headed on.
What the managers said…
Barnsley's Valerien Ismael: "It was good to win after coming from behind and it is a great feeling in football when you win the game in 90+. That's why we are very delighted about the win. It was another comeback win. We were one down and that's why it was very important to win the game.
"In the first half, it was a good game from us and we won a lot of balls but the last pass was not good enough. It was a poor game in the second half because the wind made it very difficult. We pushed right to the end because we knew set-pieces would be a big part. It will give the guys, for sure, more confidence for the next game on Tuesday."
Huddersfield's Carlos Corberan: "I think the team was competing well but we weren't able to defend well these two set-pieces. We didn't defend well and we conceded two goals from set-pieces. It was down to individual concentration. We tried to attack but we didn't create all the chances that we wanted to create.
"In the first half we started well but in the second half we didn't win enough second balls. We need to learn a lot from the situation because we need to be defensively strong from the first action until the last moment of the game. I don't think we deserved to lose but at the same time when you lose a gam it is because you didn't do something well enough in the game. We need to give the right answer to these type of situations."