Bayern Munich have signed Real Madrid midfielder Xabi Alonso from Real Madrid for an undisclosed fee on a two-year contract.
The 32-year-old had been at Real for five years following his £30m move from Liverpool in 2009.
The Spaniard, a Champions League winner in May, only signed a new two-year deal in January.
Alonso announced his retirement from international football on Wednesday after 114 caps.
Bayern moved for the central midfielder after Toni Kroos joined Madrid after the World Cup and fellow Spaniard Javi Martinez was ruled out until 2015 with a knee injury.
“He has bags of experience and a big personality,” said Bayern boss Pep Guardiola.
“We need a player with his quality and vision. I know he’s 32 but that doesn’t matter in this position, where you need intelligent players, rather than the legs and stamina for the flanks.”
Alonso said: “I had a great time here, we have won big things and now a new chapter opens for me. It was the hardest decision I’ve ever had to take.
“The club did not want me to go. It was my decision and I asked them to understand. The club didn’t share my idea but they understood my need to start a new chapter, to start from zero in a new club.”
Alonso, who won two European Championships and a World Cup with Spain, joined Liverpool from Real Sociedad in 2004 where he won the Champions League at the end of his first season.