Bristol City scored twice in the closing 13 minutes to edge a 2-1 Sky Bet Championship comeback win at Huddersfield.
It looked like Huddersfield would take the points following Josh Koroma's 43rd-minute opener but Jay Dasilva tapped home from a yard out after 77 minutes following a pin-point cross by Antoine Semenyo to level matters.
And Jamie Paterson won it for City six minutes later with a tidy finish from the edge of the box to halt a five-match winless run.
Huddersfield had dominated the half but were perhaps lucky to lead at the break after former Town striker Nahki Wells hit the crossbar.
The visitors should have taken the lead just before the Terriers hit the front when Zak Vyner headed wide.
But Bristol City improved dramatically in the closing 20 minutes with the Terriers unable to resist the growing pressure.
Christopher Schindler was unable to turn home Pipa's corner after it sailed through a crowd of players after eight minutes.
Wells hit the crossbar three minutes later after he found space on the edge of the box, while Koroma had a shot blocked following a Pipa corner as Huddersfield took control.
Pipa fired straight at goalkeeper Daniel Bentley from 20 yards after he cut inside and went past a number of defenders midway through the first half.
Callum O'Dowda blazed an effort wide on the half-hour mark after a superb turn created a shooting chance, while – at the other end – Pipa could not keep his shot down after Lewis O'Brien teed him up a minute later.
Huddersfield took the lead as Koroma slotted home from six yards two minutes before the break after a pinpoint cross from Isaac Mbenza.
Koroma curled an effort high and wide from the corner of the box as the home side started the second half on the front foot.
Pipa pulled a cross back just behind the waiting Fraizer Campbell after a flowing move from the Terriers after 56 minutes.
Bristol City boss Dean Holden introduced Famara Diedhiou just before the hour mark as he looked to get his faltering attack firing.
Tomas Kalas headed wide from a corner moments later as City continued to struggle in front of goal.
Koromo was unable to control a long ball over the top from Jonathan Hogg as he nearly got through on goal to double the lead with 20 minutes remaining.
Dasilva tapped home from a yard out in the 77th minute after Semenyo did brilliantly to win the ball back and tee up a perfect cross.
And City hit the front six minutes later when Paterson slotted home into the bottom corner after an assist from Dasilva.