The Rossoneri announced Kaka's second spell with the club was over after he exercised a get-out clause after Milan's failure to qualify for European football next season, despite still having one year left to run on his deal.
He will now join Sao Paulo, with whom he began his youth and professional career before being sold to Milan in 2003, and will then link up with Orlando City, who will become a team in the MLS in spring 2015.
"I've always said I wanted to play in the USA and now I have reached an agreement to play there," Kaka told AC Milan's television channel.
"Orlando City is a new team with a good project and the owner (Flavio Augusto da Silva) is Brazilian.
"I'm also happy to return to Sao Paulo. It's really satisfying for me."
Orlando City tweeted a silhouette of Kaka celebrating a goal with the hashtag "#KomingSoon".
Kaka only returned to the San Siro on a free transfer last summer after four years at Real Madrid.
The 32-year-old, who won a Serie A title and the Champions League in his first spell at Milan, scored seven goals in 30 league appearances in the 2013-14 season.
In total, Kaka, FIFA World Player of the Year in 2007, scored 104 goals in 307 appearances for the Rossoneri.
Milan's statement continued: "Certain loves never end, they go in big circles when a contract is mutually terminated.
"The key word is mutual.
"Ciao Ricky (Kaka), we will never leave each other."
Milan finished a disappointing eighth last season and failed to qualify for European competition for the first time in 16 years.
Kaka added he will never again wear the number 22 - the number he wore at Milan.
"In Brazil, I think I will wear the number 8 and then 10 in America," he said.
Milan captain Riccardo Montolivo paid tribute to his former team-mate, writing on his Facebook page: "It was an honour to be your team-mate. Thanks for everything and good luck for your career."
- Sports & Recreation
- AC Milan
- Orlando City