Xabi Alonso will move to Real Madrid from Liverpool pending a physical. Xabi Alonso will move to Real Madrid from Liverpool pending a physical. (Jasper Juinen/Getty Images)

Liverpool agreed Tuesday to sell Xabi Alonso to big-spending Real Madrid, subject to the Spanish international midfielder passing a medical.

Liverpool, which finished second in the Premier League last season, said the terms of the deal will remain confidential. Real confirmed the agreement on its website without giving specifics, and said Alonso would be in Madrid on Wednesday for the medical.

"His arrival at Real Madrid will reinforce the midfield making him one of the axes on which [Madrid coach Manuel] Pellegrini's squad will rotate," Real said.

Spanish media also reported that veteran defender Michel Salgado is set to leave the club with a year remaining on his contract.

Though neither club gave details of the Alonso deal, Spanish media reported that a fee of €30 million, about $46.4 million, had been agreed for the 27-year-old, who will be given a four-year contract, according to the website of El Mundo newspaper.

The paper added that he would earn €4.5 million, or $7 million Cdn, a year and that his signing closes Madrid's summer buying spree.

The move would take Real's recent spending to more than $320.5 million, with the club having already brought in the likes of Portugal winger Cristiano Ronaldo from Manchester United, Brazil playmaker Kaka from AC Milan and France striker Karim Benzema from Lyon.

The spree since Florentino Perez regained the Spanish club's presidency in June is designed to take Real back to the top of the game after its bitter rival Barcelona won the Spanish league and cup double, along with the Champions League, last season.

Alonso, who joined the Reds in 2004 from Real Sociedad and helped the English club win the Champions League in 2005, has been a regular under Liverpool's Spanish manager Rafa Benitez.

At the international level, he also helped Spain become European champion in 2008.