The Brazil international had been a free agent since leaving Sao Paulo in September.
Sources previously told ESPN that Barca were reluctant to bring Alves back, but the return of Xavi, who was appointed as manger last week following the sacking of Ronald Koeman, caused a change of opinion.
The club said in a statement: “FC 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. The Brazilian will be joining training from next week but will not be able to play until January.
Back in DA house! pic.twitter.com/qicb8RRc1h
— FC Barcelona (@FCBarcelona) November 12, 2021
“The club will announce the full details at his official presentation as a new FC Barcelona player.”
He later had a spell with Paris Saint-Germain before leaving in 2019 to spend two years with Sao Paulo.
With the World Cup around the corner in Qatar next year, Alves, who won an Olympic gold medal with his country this past summer, is keen to find top-level football in a bid to make Tite’s squad for the tournament.