In 2019, he took over at Roma, whom he led to fifth and seventh in Serie A, before heading to Lille, taking them to fifth and fourth in Ligue 1 and guiding them into Europe in both seasons he had in France.
Milan are coming off a trophy-less season -- their 19th league title came in 2022 -- where they were second best by some distance to city rivals Inter who won the title.
They were eliminated from the Champions League at the group stage, finishing third behind Dortmund and Paris Saint-Germain and lost to AS Roma in the quarter-finals of the Europa League
The announcement marks Fonseca the second big managerial change in Italy in two days.
On Wednesday, Juventus named Thiago Motta as their successor to Massimiliano Allegri who was sacked last month.
jr/cyj/mdm/bsp/gj/