Current Bayern coach Hansi Flick announced that he would be leaving the Bavarians at the end of the season despite only taking over last campaign.
However, Bayern have now confirmed Nagelsmann as their new head coach from next season and Flick's contract will be terminated at the end of the current campaign.
"FC Bayern have appointed Julian Nagelsmann as their new head coach. The Bavarian-born 33-year-old will move to Munich from RB Leipzig on 1 July 2021 ahead of the new season, signing a five-year-contract with the German record champions until 30 June 2026," a statement on the website read.
"This comes after FC Bayern agreed to current head coach Hansi Flick's request to have his contract terminated on 30 June 2021, two years earlier than its original expiry date."
It is believed that champions elect made contact with Leipzig on Sunday and agreed terms with the highly-rated manager.
Nagelsmann came to prominence after guiding Hoffenheim to the Champions League group stages for the first time in their history in the 2017-2018 season, before he went on to join fellow German outfit RB Leipzig.