Dani Alves played for the Camp Nou outfit between 2008-2016 when he lifted the Champions League title three times alongside Xavi
Barcelona announced on Friday that veteran defender Dani Alves will be returning to the club as new coach Xavi Hernandez's first signing.
Alves, 38, has been a free agent since leaving Sao Paulo in September but is ineligible until the transfer window opens early next window.
He played for the Camp Nou outfit between 2008-2016 when he lifted the Champions League title three times alongside Xavi.
"Barcelona and Dani Alves have reached an agreement in principle for the player to join the football first team for the remainder of the current season," they said.
"The Brazilian will be joining training from next week but will not be able to play until January.
"In the Catalan capital, he made the right back slot his own across eight seasons, making 391 official appearances and scoring 23 goals.
"Alves has also played for Brazil, winning six major titles, most recently the Tokyo Olympic Games, where he lined up in the final against what are now his team-mates Oscar Mingueza, Eric Garcia and Pedri," they added.
Alves will compete with USA youngster Sergino Dest for a starting berth with Spain centre-back Oscar Mingueza also able to cover at right-back.
Xavi was presented as the club's new boss on Monday to replace the sacked Ronald Koeman returning to the side where he won eight La Liga titles and four Champions Leagues as a player.
Despite club debts of more than a billion euros ($1.16billion), Xavi is tasked with returning Barcelona to Europe's elite and recovering a style of play most associated with Johan Cruyff and Pep Guardiola.
Xavi's priority this term will be to ensure Barcelona qualify for next season's Champions League by finishing in La Liga's top four.
They also face a fight to make the last 16 of this season's tournament, with a crunch game away to Benfica to come later this month.
The Catalans' next match after the international break is on November 20 at home against city rivals Espanyol.