The former Barcelona coach will leave Allianz Arena at the end of the season amid links with Manchester City and United, and will be replaced by the experienced Italian.
Bayern Munich has announced that Carlo Ancelotti will take charge of the club next season and replace Pep Guardiola, who is to depart.
The Spanish coach has enjoyed remarkable success in Bavaria in his spell as manager, winning two Bundesliga titles, one DFB-Pokal, the UEFA Super Cup and the FIFA Club World Cup, but will leave after choosing not to renew his contract.