Alves has signed a contract with the Brazilian giants until December 2022, it was announced on Thursday.
"Daniel Alves is the embodiment of what this management envisions for Sao Paulo – one of the leading players in the world and recognised for his immense professionalism, his fierce determination and his endless thirst for titles and victories," club president Carlos Augusto de Barros e Silva said in a statement.
"He is also a socially engaged citizen and passionate about our country. Sao Paulo, therefore, wins on every possible front.
"One day I told Daniel that he would come to play at Sao Paulo, the club of his heart. Today I have the immense joy and pride to have kept that promise."
Alves captained Brazil to Copa America glory on home soil in July – taking his career haul to 40 trophies.
The veteran's transfer was announced in a video on Sao Paulo's Twitter account, with the defender expressing his excitement to be back in his native country playing for the club he supported as a child.
"I could've picked any other team to play for," Alves said. "But I chose to come back to Brazil, to my country, to my people. To the club I love.
"It's unreal, but I'm here!"
Sao Paulo also posted on Twitter that Alves would wear the No. 10 jersey at his new club.
😍🇾🇪 O meu craque veste a 10! É isso: @DaniAlvesD2 é o novo camisa 10 do Tricolor. Corre para comprar a sua, personalizada com o nome e o número dele: https://t.co/FqSdXLRPMh #DaniEstáAqui pic.twitter.com/MvM15DlIj8— São Paulo FC (@SaoPauloFC) August 2, 2019
Last week, Alves took to Instagram in a tongue-in-cheek post, asking where he should send his CV as he looked for a new team.
But Alves has now landed back in his home country, where he will play at the club level for the first time in 17 years.