The hosts came close to taking the lead in the sixth minute, but James Hayter's header came back off the bar.
© Getty Images
Daniel Ward had a good opportunity for the visitors midway through the first half, but curled his strike wide of the post.
Their lead didn't last long, as four minutes later Lawrence fired in a free kick from just outside the box.
With the game heading towards a draw, Huddersfield snatched the winner in the seventh minute of stoppage time after Clayton fired in from close range.