Dani Alves is heading back to Barcelona.
The 38-year-old agreed to rejoin the club he left more than five years ago, finalizing an agreement Friday on a contract until the end of the season.
Barcelona said Alves will be available to play starting in January.
He’s returning to Camp Nou as a free agent, having cut ties with Sao Paulo in September, and expected to compete for starts at the right-back position with prospective proteges Sergino Dest and Oscar Mingueza.
Alves could also play as a right-winger, as he did in Brazil with Sao Paulo.
The club was reluctant to bring back Alves up until it hired Xavi as manager, sources told ESPN’s Sam Marsden and Moises Llorens. Xavi, Alves’ former teammate, reportedly sees the Brazilian as the ideal mentor to Barcelona’s young crop of players.
The outspoken full-back appears to have made amends with the La Liga giants after criticizing them for mistreating him upon his departure in June 2016.
He famously ripped into Barcelona’s executives after joining Juventus on a free transfer, calling them “false” and “ungrateful” in February 2017.
“They did not respect me. They only offered me a renewal when they were given a transfer ban by FIFA,” he said. “That was when I came into play and signed a deal with a termination clause.
“The people who run Barcelona today have no idea how to treat their players.”
Many of those people have relinquished their roles in the years since his departure. Josep Maria Bartomeu, who was president at the time, resigned last year after losing the confidence of club members.
Alves brings a wealth of experience back to Barcelona. He’s widely considered the most decorated player of all time, with 43 trophies to his name at the senior level.