The 37-year-old Dutchman, who has no previous coaching experience, told a news conference that he was retiring as a player. He left Milan for Brazil's Botafogo in 2012.
"This isn't a goodbye, we'll meet again," he said at Botafogo's stadium.
"All the experience I have gained in this year and a half at Botafogo is going to help me in my next venture, which will be as coach of Milan."
Seedorf's agent Deborah Martin said he had signed a two-and-a-half year contract to replace Massimiliano Allegri, who was fired by Milan on Monday following a dismal run of results for the seven-times European champions.
Seedorf said he was not considering retiring but that the offer to return to Milan was too good to turn down.
"The decision (to sack Allegri) was decisive," Seedorf told reporters. "The call came in the middle of the training session. Obviously, it's a place where I spent 10 years of my life and I have a very close relationship with the president so when he asked me I couldn't say no."
The move to appoint Seedorf, who had a successful 10-year playing career at Milan, is something of a gamble although he is a hugely popular figure at the club and would arrive with a deep bank of goodwill.
The midfielder was the first player to win the Champions League with three different clubs - Ajax Amsterdam in 1995, Real Madrid in 1998 and AC Milan in 2003 and 2007. He has also represented Inter Milan and Sampdoria.
The former Dutch international won two league titles and an Italian Cup to go with the two Champions League victories during his time at Milan, during which he was also awarded the UEFA Best Midfielder Award in 2007.
Milan are currently 11th in Serie A after squandering a two goal lead in a 4-3 defeat at promoted Sassuolo on Sunday night. That left them 30 points behind leaders Juventus and 20 points off the final Champions League berth occupied by Napoli.
Allegri managed just five wins in 19 league games this season and was fired on Monday morning.
There has been sympathy for Allegri, who won the Serie A title in his first season in 2010-11 but has since had to deal with the loss of Thiago Silva, Zlatan Ibrahimovic, Andrea Pirlo, Alessandro Nesta, Gennaro Gattuso and Seedorf himself during a tough transitional period at the club.
Allegri guided Milan into the Champions League with a late Philippe Mexes goal on the last day of last season but they face a tough prospect in the round of 16 next month against high-flying Atletico Madrid.
Seedorf joined Botafogo in 2012 on a two-year contract the club said was the best ever given to a foreign player.
His drive and often admired professionalism helped turn the club's fortunes around and 2013 was their most successful season in years.
Botafogo won the Rio state championship in May and finished fourth in the Serie A, a placing that took them into the Copa Libertadores, South America's version of the Champions League, for the first time since 1996.
"After 22 years, it was a difficult night," Seedorf said of his decision to retire. "But I am very satisfied with what I've done in my career and with what I managed to do with Botafogo.
"One of the most important objectives was to put them back on top and get them back in the Libertadores for the first time in 17 years. The clubs deserves it, the fans deserve it and the players deserve it."
However, Seedorf had also expressed disappointment at the lack of passion among Botafogo's fans. The club's average attendance was only 13,000, a low number for a city of almost 10 million people.
Like many Brazilian clubs Botafogo suffered from serious financial problems, and players were not always paid on time. The club's new stadium was closed in March, after authorities said the roof was in danger of collapsing in high winds.
- Sports & Recreation
- Massimiliano Allegri
- Champions League
- Inter Milan
- AC Milan