Heynckes, who will be returning for a third spell at the club, will succeed Louis van Gaal, whose contract will be terminated by mutual consent at the end of the season.

Current Bayer Leverkusen boss Heynckes has agreed a two-year deal at the Allianz Arena.

Heynckes quickly emerged as the first choice of the Bayern board when it was announced on March 7 that Van Gaal would be leaving.

The much-travelled 65-year-old led Bayern to two Bundesliga crowns in his first spell in charge, between 1987 and 1991, before going on to coach Real Madrid among others.

He returned to Bayern two years ago and guided them for the final five games of the season after Jurgen Klinsmann was sacked, leading them into the Champions League before making way for Van Gaal.

Bayern chairman Karl-Heinz Rummenigge said: "Jupp Heynckes was our preferred candidate.

"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 described returning to the Allianz Arena as "fascinating".

He said: "Aside from the good personal relationships I have with the leading figures at Bayern, the club has always impressed me with its professionalism.

"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."

Former Germany international Heynckes has impressed during his time at Leverkusen after taking over in June 2009.

The BayArena side are currently in second spot in the Bundesliga and on course for a place in next season's Champions League.

Bayern, meanwhile, are in fourth, seven points behind.