The 32-year-old has a clause in his Charlton contract allowing him to leave the club for free if they were relegated.
Hreidarsson told BBC Sport: “I’ve always had a lot of respect for Harry. I nearly joined him four years ago at Pompey before I signed for Charlton.
“It was a tough call not to go then and I’m delighted to have a second chance.”
Hreidarsson has signed a two-year deal with Portsmouth.