Posh had looked to be out of it when they slipped into a two-goal deficit, but produced some stunning football to hit four goals and leave Town stunned.
Full-debutant Graham Carey delivered a corner from which Jordan Rhodes headed the opener after 22 minutes - and the player borrowed from Celtic soon went from provider to goalscorer as he doubled the lead with a smashing 33rd minute free-kick. Anthony Pilkington also smashed against the crossbar as Huddersfield dominated.
But their stranglehold was broken in first-half stoppage time. Keeper Alex Smithies allowed a George Boyd shot to slip through his grasp as Town conceded for the first time all season - and their usually tight defence was then blown to shreds after the interval.
Aaron Mclean hauled Posh level when sweeping home a free-kick in the 50th minute and the hosts quickly hit the front when Jamie McCombe inadvertently sent the ball into his own net after Craig Mackail-Smith had dashed clear.
A fine second from Mclean in the 67th minute sealed Posh's success, but that was by no means the end of the drama. Scott Arfield squandered a golden chance for the visitors before substitute Gary Roberts struck a post in the dying moments.