The 26 year-old spent most of his career to date in the second tier with Millwall. He played 175 times for the Lions, scoring 12 goals before leaving the club to join League One strugglers Gillingham on a short-term contract in January.
Thompson has signed a two-year contract with Posh with an option of a third year.
"It’s been a bit of a whirlwind with talks and stuff, but I’m delighted to get the deal over the line," Thompson said. “It’s something different for me with having to relocate the family, but I’m raring to get going.
"The forces have aligned really. I want to get back to the Championship and the club shares that ambition. I had a fantastic time at Millwall and really enjoyed it at Gillingham, but now I want to do my bit for my new team by playing as many games as I can. I like to play centre midfield and I’m happy to do both sides of the job, defensively and attacking.
"New dressing rooms can be daunting, but I know Nathan Thompson from a loan spell I had at Portsmouth, and I know Mark Beevers and Sammie Szmodics. I’ve played against a few of the lads as well and I’m sure they will make me feel welcome.”
The Posh squad are expected to return for pre-season training on June 22. The League One fixtures are scheduled for release on June 23.