Xabi Alonso
Real Madrid's Xabi Alonso addresses a news conference in Gelsenkirchen.Reuters

Bayern Munich have confirmed that Real Madrid midfielder Xabi Alonso is all set to complete his move to the Bundesliga champions.

The 32-year-old has agreed to join Bayern on a two-year contract for a fee understood to be around £5million. 

The former Liverpool star was previously linked with a move back to the Reds and also to Manchester United, after spending five years at Madrid, but it has now been confirmed that the Spaniard is moving to Bayern instead.

Bayern executive board member Jan-Christian Dressen also confirmed the move and revealed the progress of the deal.

"We have an agreement with Xabi Alonso. And we hope to find an agreement with Real Madrid in the next one or two days," Dressen said. "We are not talking about a loan this would be a permanent signing."

After injuries to midfielders Thiago Alcantara, Bastian Schweinsteiger and Javi Martinez, Bayern have been looking for someone with experience for the centre midfield position.

"If that will work, I would have a very good feeling for the club and the coach," Bayern sporting director Matthias Sammer pointed out.

"After the injuries of Thiago and Schweinsteiger we have been looking for someone, who could help us immediately. And Xabi Alonso could play on top level for two years."

Alonso was one the key players for Spain during their dominant era in international football.

The midfielder had announced his retirement from national duty on Wednesday via Twitter. 

"It had been an enormous honor to play for Spain for 11 years," he wrote.

Alonso made his international debut in April 2003 and played for his country for 11 years, making 114 appearances and scoring 16 goals. He started every game at the 2010 World Cup in South Africa, where Spain won their first ever world title. Alonso was also part of the La Roja team, which won the 2008 and 2012 European Championships.