Pawel Abbott scored a last-minute penalty to complete a stunning fightback and seal Huddersfield's first win in 11 matches.
Abbott's second-half double allowed Huddersfield to turn around a 2-0 half-time deficit.
Huddersfield boss Peter Jackson was ordered into the stands for the second time this season when he disputed Swansea's second goal two minutes before half-time.
Even his opposite number Kenny Jackett agreed that the throw which led to the second of Lee Trundle's goals should have gone Town's way.
While Jackson's players argued with referee Neil Swarbrick, Swansea played on and Thomas Butler set up Trundle for a far post finish.
Jon Worthington and a double from Abbott pulled the game around for Huddersfield in the second half.
Even then the drama wasn't complete as Trundle, who scored both Swansea goals, was sent off for violent conduct and is set to miss Saturday's FA Cup tie at Sheffield United.
Gary Taylor-Fletcher forced Swansea keeper Willy Gueret into a good stop in the opening minutes and then Andy Holdsworth slid a perfect pass to Worthington but Alan Tate nipped in with a brilliant saving tackle in the box.
Swansea went in front in the ninth minute when there seemed no danger. Huddersfield centre-back Martin McIntosh tried to shield the ball back to keeper Matt Glennon but Ian Craney stole in on his blind side and was tripped by Glennon.
Trundle stepped up and scored from the spot, although Glennon guessed the right way.
Swansea, unbeaten in the previous four games, grew in confidence and Trundle had another effort but missed the target when clean through.
Craney had a powerful shot beaten out by Glennon before tempers frayed again. Chris Brandon went down in the box and Tate handled the ball but Mr Swarbrick waved away the appeals.
Jackson was incensed at that and was fuming again later when Mr Swarbrick refused to stop play after Holdsworth was scythed down. When he did finally receive treatment Holdsworth limped off and was replaced by Abbott, forcing a Town reshuffle.
Swansea went further ahead two minutes from half-time when Mr Swarbrick gave Swansea a throw which appeared to deflect out off Marcos Painter.
Swansea took the throw while Jackson and the Town players were still arguing and Butler rolled a pass to Trundle to fire past Glennon.
Jackson was then sent to the stands and Mr Swarbrick left the field to a chorus of boos at the break.
Jackson sent his men out five minutes early for the second half and Huddersfield were fired up and transformed.
Huddersfield were back in the game in the 67th minute when skipper Worthington fired home into the roof of the net.
That lifted the crowd and the players and eight minutes later Town were level. Taylor-Fletcher started the move down the right and his cross into the box meant Town had an extra man. Brandon stepped over it allowing Abbott to curl the ball home at the far post.
Trundle had the chance to win it four minutes from time with a superb effort but Glennon turned his shot away.
Huddersfield though grabbed all three points when Painter fouled Abbott in the box and the big striker slotted home the penalty before Trundle needlessly saw red right at the death.