Bayern Munich have confirmed Julian Nagelsmann will become their new head coach next season.
The 33-year-old will join on July 1 with RB Leipzig getting up to a world-record €25m for a manager, including bonuses, as compensation, according to Sky Germany.
The contract length is also a new record for Bayern Munich as Nagelsmann joins the Bundesliga champions on a five-year deal
- David Alaba to join Real from Bayern on five-year deal
- Bayern 'disapprove' as Hansi Flick asks to leave
- Lother Matthaus: Flick will leave Bayern to take Germany job
Nagelsmann took RB Leipzig to last season's Champions League semi-finals and they are on course to finish second behind Bayern in the Bundesliga this campaign.
Nicknamed 'Baby Mourinho', Nagelsmann has developed a reputation as one of the best young coaches in Europe and had also been linked with the vacant managerial post at Tottenham.
Nagelsmann will succeed Hansi Flick, who last week asked Bayern to terminate his contract at the end of the season after several disagreements with sporting director Hasan Salihamidzic.
The club also confirmed an agreement had now been reached for the early termination of Flick's contract which was originally set to run until 2023.
Flick has been linked to the German national team after it was announced current boss Joachim Low would leave his position as manager at the end of this summer's European Championship.
On the appointment, Bayern president Herbert Hainer said: "Julian Nagelsmann stands for a new generation of trainers.
"Despite his young age, he has had an impressive career. We are convinced that with Julian Nagelsmann we will build on the great successes of the past few years.
"I would like to expressly thank Hansi Flick on behalf of FC Bayern. He took over our team in a difficult phase in 2019 and then won six titles, the seventh will hopefully follow soon.
"It will always have a place in the history books of FC Bayern. We wish him all the best for his future."
Flick had an incredible 18 months in charge at the Allianz Arena, winning a league, cup and Champions League treble last season and again putting Bayern on course for a ninth successive league title this season as well.
On his Bayern departure, Flick said: "The past two years will be unforgettable for me. I really enjoyed the emotions, the victories, the titles, but also the daily work on the pitch - it was an outstanding time.
"Success can only be achieved together! A coach is nothing without his team and I was lucky enough to meet fantastic players here in Munich and a staff and a team of coaches that did incredible things. Thank you guys!"
Nagelsmann also wrote on RB's Leipzig's website, saying it was with a "heavy heart" he was leaving: "I've been able to coach a special team here at a club with huge opportunities and the best possible conditions to work in.
"Everybody here, including the staff who work alongside the team, have ensured that we've written plenty of stories for the club's history books and are continuing to do so now. I'm really proud of that.
"Our run to the Champions League semi-finals was definitely the highlight of our time together. It was a moment that I'll never forget.
"We're currently enjoying the best Bundesliga campaign in the club's history too. We want to make sure it ends up our best finish and then also lift a major trophy for the first time as well.
"It's too early to say my goodbyes and speak about my memories because I'm not done here yet in Leipzig.
"My mission may end here in the summer, but I will give my absolute all until then. We've grown into a real tight-knit bunch that finally wants to win a title."