The new deal will keep the 36-year-old at Portsmouth until the end of the season.
Hreidarsson has been out of contract since his contract with Pompey expired at the end of the last season.
“I’m delighted to have signed again for such a great club where I have had a fantastic time,” Hreidarsson told the club’s official website.
“It’s great to be fit again and I can’t wait to get out there and pull on a blue shirt again.”
Chief executive David Lampitt added: “Hermann is a legend and embodies everything great about this club. We’re delighted to have him back and available.”