A Bayern Munich official says the Bundesliga champions are set to sign midfielder Xabi Alonso from Real Madrid.

Bayern financial director Jan-Christian Dreesen says Alonso was expected in Munich on Thursday for his medical. Alonso and Bayern have "in principle" agreed on a transfer and the two clubs are "in friendly talks" about a deal expected to be completed within a couple of days.

Alonso won the 2008 and 2012 European Championship and the 2010 World Cup with Spain before retiring from the national team this week.

Alonso would be the fifth Spaniard to play for Bayern, whose coach is another Spaniard, Pep Guardiola. Other Spaniards on the team are Javi Martinez, Thiago Alcantara, Pepe Reina and Juan Bernat.