Berlin: German champions Bayern Munich are close to signing former World and European champion Xabi Alonso from Champions League winners Real Madrid, they said on Thursday.

The 32-year-old midfielder, who on Wednesday announced his retirement from international soccer after winning one World Cup and two European championships with Spain, is considered as a replacement for the injured Javi Martinez.

He can help orchestrate Bayern’s game from his deep-lying position while also providing leadership with holding midfielder Bastian Schweinsteiger and Thiago Alcantara both out injured.

Bayern finance chief Jan-Christian Dreesen and Matthias Sammer told reporters terms had “basically” been agreed and the player would arrive later on Thursday for a medical.

“We have basically agreed terms with Xabi Alonso. He will arrive today for his medical,” Dreesen said. “We are in friendly talks with Real and am confident that in one or two days there will be agreement with Real as well.” He said, however, Bayern were eager to sign him rather than take him on loan with Alonso’s contract running out in 2016.

The transfer of Alonso, who will be Bayern’s fifth Spanish player along with Pepe Reina, Juan Bernat, Thiago Alcantara and Martinez, comes just one day after the club signed central defender Mehdi Benatia from AS Roma for a reported €25 million (Dh121 million).

“This is purely sporting decision because Alonso can instantly help us and boost our quality,” Bayern sports director Matthias Sammer said. “He can play top level football for at least two more years.” Martinez has been ruled out for at least six months with a cruciate ligament tear, forcing fellow Spaniard, coach Pep Guardiola, to look for more defensive midfield options.

The 32-year-old issued a statement on Wednesday in which he said “the most difficult thing was to say ‘goodbye’ to international football,” reports Xinhua.

“After a lot of thought, I think that moment has arrived,” he commented. “I am putting an end to a glorious era for the Spanish national team, which started 11 years ago after forming part of a historic generation which has helped fulfil the dreams of millions of fans.”

Alonso made his debut in 2003 and after the disappointment of the 2006 World Cup, he was an integral part of the Spain side which conquered the 2008 and 2012 European Championships as well as winning the 2010 World Cup in South Africa.

However, like so many of his companions, he was disappointing in Brazil during the summer as Spain crashed out of the first stage of the World Cup and like Barcelona’s midfield general, Xavi Hernandez, who he partnered so often on the pitch, he too has decided to draw the curtain on his international career.

Their retirement means that when Spain coach Vicente del Bosque names his squad for a friendly match against France and the first qualification game for the 2016 European Championships Friday, he will have to start rebuilding his midfield.

“Xabi Alonso has left us an incredible legacy,” commented Del Bosque on Alonso’s retirement.