In addition, Bayern will pay Real Madrid €5m per season for Rodríguez and they will also pay all of his wages, believed to be €8m for the first year and €8.2m for the second.
The 25-year-old, signed a six-year contract at Real after joining from Monaco for £71m in July 2014.
Despite being the best player in the 2014 World Cup, Rodríguez was never able to establish himself as a starter in the Real Madrid line-up and as a result managed only 22 appearances in La Liga last season. The Colombia captain was also left out as Zinedine Zidane’s side beat Juventus in the Champions League final.
Karl-Heinz Rummenigge, the Bayern executive board chairman, said:
“We are very happy that we have managed to conclude this transfer. The signing of James Rodríguez was the big wish from our manager, Carlo Ancelotti, after the two of them worked together successfully at Real Madrid.
“James is a very versatile player. He scores a lot of goals himself and is also able to set up goals and sets overall high standards. We have, without question, heightened the quality of the squad with this transfer.”
Rodríguez will join up with the Bayern squad immediately and travel with his new team-mates on the 12-day tour in China and Singapore.
Bayern are expected to sell Douglas Costa to Juventus. The German side have already signed Corentin Tolisso (Lyon, £36.4m), Serge Gnabry (Werder Bremen, £7.7m), Sebastian Rudy (Hoffenheim, free), Kingsley Coman (Juventus, £18.4m) and Niklas Süle (Hoffenheim, £19.3m).