Julian Nagelsmann will take over as Bayern Munich coach from next season to replace Hansi Flick, the reigning German champions announced on Tuesday.
Nagelsmann, who is just 33, will move from RB Leipzig on a five-year contract after Flick, whose relationship with the club's powerful sporting director Hasan Salihamidzic has deteriorated over transfer policy, asked to be released from his contract.
According to widespread reports in Germany, Bayern will pay significant compensation to Leipzig of up to 25 million euros ($30.2m) for Nagelsmann, whose contract at the Red Bull-backed club was due to run until 2023.
"I am convinced that Bayern's sporting future will be a very successful one with Julian Nagelsmann," Oliver Kahn, the former goalkeeper who will succeed Karl-Heinz Rummenigge as Bayern chairman next year, told the club's website.
Nagelsmann has never hidden his desire to coach Bayern, especially as he comes from the Bavaria region.
Last season, he led Leipzig to the Champions League semi-finals as well as third place in the Bundesliga, and this season his side has replaced Borussia Dortmund as Bayern's main title challengers.
With three games remaining, Leipzig are the only team who can still prevent Bayern from winning a ninth consecutive Bundesliga title, although they sit seven points off the pace.
Flick took over as Bayern coach in late 2019, succeeding the sacked Niko Kovac.
He won the Bundesliga and German Cup last season and added the Champions League, as Bayern beat Paris Saint-Germain in the final in Lisbon to become European champions for the sixth time.
Bayern added the UEFA and German Super Cups at the start of this campaign and won the Club World Cup in February.
However, as reports of a rift between the former Germany assistant coach and Salihamidzic emerged, Bayern were knocked out of the Champions League in the quarter-finals by PSG earlier this month.
"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," the club said.
Germany's football association (DFB) said later on Tuesday it planned to hold talks with Flick about replacing departing national team boss Joachim Loew after Euro 2020.
"It's well known that Hansi Flick is held in high regard by the federation. We can confirm that, in this context, we will now also have discussions with him and Bayern officials," a DFB spokesperson told AFP subsidiary SID.
Of his time at Bayern, Flick said: "The last two years will be unforgettable for me. The emotions, the wins, the titles, but also the day-to-day work on the pitch have been a lot of fun for me, it's been an amazing time."
Nagelsmann spent time on the books at Bayern's neighbours 1860 Munich, before his playing career was cut short by a knee injury aged just 20.
He moved into coaching and became the youngest permanent head coach in Bundesliga history when appointed by Hoffenheim in February 2016 at the age of 28.
He steered them to safety in that season before successive top-four finishes in the next two campaigns.
His star has continued to rise at Leipzig where a young side has established itself as a leading force in the Bundesliga and in Europe.
"Julian Nagelsmann represents a new generation of coaches. Despite his young age, he already has an impressive CV. We are convinced...we can continue the magnificent successes of recent years," Bayern president Herbert Hainer said.
One of the stars of Nagelsmann's Leipzig team has been France defender DayotUpamecano, the 22-year-old who will also join Bayern next season.
That transfer was announced in February. Upamecano, who had a 43 million-euro buyout clause in his contract, also agreed a five-year deal at the Allianz Arena.
Leipzig will now begin their search for a new coach but should have the carrot of Champions League football next season to dangle before the candidates.
"Julian has taken a fantastic path in Leipzig and developed the club very successfully," said Leipzig CEO Oliver Mintzlaff, adding that he had "taken the team as a collective to the next level."