Bayern Munich confirmed on Friday Bayer Leverkusen coach Jupp Heynckes will take over at the Bundesliga champions on July 1.
Heynckes announced on Monday he will leave Leverkusen at the end of the season, and the 65-year-old has already met with Bayern's chairman Karl-Heinz Rummenigge, board member Karl Hopfner and director of sport Christian Nerlinger.
"Jupp Heynckes was our preferred candidate," Bayern chairman Karl-Heinz Rummenigge said.
"We are very happy that we could reach agreement on a two-year contract. I'm convinced that with Jupp Heynckes we will have a successful collaboration."
Heynckes revealed he was fascinated by a return to the Bavarian club, who he last led in 2009.
"Aside from the good personal relationships I have with the leading figures at Bayern, the club has always impressed me with its professionalism," he said.
"I have twice been Bayern coach and always appreciated the working environment. It's natural that you have to have success as Bayern coach, I understand that, but I see it as a fascinating task to achieve it with the team over the next two seasons."
The German coach has already had two spells in charge of the reigning Bundesliga champions returns to Bavaria as a replacement for the departing Louis van Gaal.
Heynckes coached Bayern for the final five games of the season in 2009 after former national team boss Jurgen Klinsmann was dismissed.
Dutch coach Van Gaal's contract will be terminated by mutual consent in June, and Bayern have turned to Heynckes after being impressed by the work he has done in leading Leverkusen to second place in the Bundesliga.
Bayer director of sport Rudi Voller has warned Heynckes against trying to take Arturo Vidal with him when he leaves the club in the summer.
Heynckes is expected to be appointed as the new coach of Bayern Munich for next season and Vidal is one player he appears keen on taking with him, but Voller is convinced that the Chile midfielder will stay put. Voller also expects goalkeeper Rene Adler to remain at the club next season despite rumours of interest from Manchester United.
"I am quite sure right now that Rene and Arturo will be playing for us next season,'' he told the Express newspaper. "We want to extend their contracts and are prepared to push the boat out, but a lot still depends on whether we play in the Champions League next season.''
Both Adler and Vidal are out of contract in 2012 and, should they not sign a new contract, Bayer can only demand a substantial fee for them this summer, but Voller says there has been "no official enquiry'' for either of them.
Heynckes' talks with Bayern have been made official, however, and Voller says he has every right to talk to them after announcing he would not be extending his contract with Leverkusen in the summer, thus becoming a free agent.
"When Bayern call, it can make you go weak at the knees,'' Voller said. "If Jupp gets the chance to work there for a third time then it is obvious that he considers it. That is how this business works. It is perfectly legitimate.''