Ryan Williams has returned to Fratton Park on a two-year deal.
The 25-year-old Australia international winger will officially join Pompey on July 1 when his Rotherham contract expires.
He previously made six senior appearances for the Blues as a teenager after progressing through the youth system.
Blues boss Kenny Jackett said: “Ryan is out of contract and we’re pleased that he’s chosen Pompey, who were his first club many years ago.
“He’s an attacking winger who can play on either side and ensures we have good competition in that area.
“Ryan’s just made his debut for Australia, but has been in England for many years now and established himself.
"He’s delighted to come back and is doing so in his prime."
“He speaks very fondly of this club and has continued to follow them. He’s delighted to come back and is doing so in his prime.”
Williams joined Pompey as a scholar in 2010 and made his debut as a substitute in a Championship draw at Middlesbrough on the opening day of the 2011/12 campaign.
He featured five more times that season, including in an FA Cup defeat to Chelsea at Stamford Bridge.
Williams moved to Fulham during the January transfer window and then switched to Barnsley – following a loan spell – in the summer of 2015.
Rotherham signed him two years later and he helped them secure play-off promotion to the Championship in 2017/18, making a total of 88 appearances.
Williams – whose older brother Rhys currently plays in Saudi Arabia – won his first senior cap for the Australia national team against South Korea earlier this month.