Marvin Johnson opened the scoring for Neil Warnock’s side before goals from Carel Eiting and Fraizer Campbell put the hosts 2-1 up.
Boro looked like they would take a point when Britt Assombalonga converted a late penalty but there was still time for Josh Koroma to score a winner.
Our Middlesbrough writer Joe Nicholson has dished out his marks following the match – scroll down and flick through the pages of our picture gallery to see them:

5. Marc Bola - 6
Made a few forays forward early on but was forced back as Huddersfield took control of proceedings. 6 Photo: Clive Brunskill

6. Jonny Howson - 6
Kept beavering away and plugging gaps but wasn’t able to get a grip of proceedings. 6 Photo: Getty Images

7. George Saville - 5
Worked hard in midfield but spent most of the afternoon chasing the ball. Conceded possession for Huddersfield’s second goal. 5 Photo: Getty images

8. Djed Spence - 5
A frustrating afternoon on the right as Boro struggled to make things click in the final third. 5 Photo: Getty Images

