(CNN) -- Liverpool midfielder Xabi Alonso is expected to sign for Primera Liga giants Real Madrid on Wednesday after the two clubs agreed a fee believed to be in the region of $50 million for the Spanish international.
Xabi Alonso is set to become Real Madrid's latest big-money signing after joining from Liverpool.
The end of a summer-long saga over the 27-year-old's future ended on Tuesday when Liverpool issued a short statement effectively bringing to a close his spell on Merseyside.
The statement read: "Liverpool Football Club this evening confirm they have reached agreement for the sale of Xabi Alonso to Real Madrid, subject only to a medical. The terms of the deal will remain confidential and undisclosed."
Although Liverpool will not reveal the details of the deal, privately sources are maintaining that manager Rafael Benitez had finally got his way over the transfer fee. Latest transfer gossip and rumors
It is believed that Madrid made another attempt to end the deadlock on Tuesday with an offer of $50m that will rise to $57.5m depending on Alonso's success over the first two years of what is believed to be a five-year contract.
Real Madrid issued a statement of their own, confirming he will have a medical on Wednesday.
Assuming all goes well, Alonso will join his former Liverpool team-mates Alvaro Arbeloa -- who moved last week for $6 million -- and goalkeeper Jerzy Dudek at the Bernabeu.
With the Alonso deal, Real president Florentino Perez will have spent around $375 in two months on Cristiano Ronaldo, Kaka, Raul Albiol, Esteban Granero, Arbeloa, Alvaro Negredo and Karim Benzema.
Alonso joined Liverpool from Real Sociedad in August 2004 for $17.5 million and scored 19 goals in 210 games, including a goal in Liverpool's memorable Champions League final victory over AC Milan in 2005.
Meanwhile, as Alonso prepares to arrive, Madrid are continuing to prune their inflated squad, as they look to get it down to the 25-player Spanish Primera Liga limit.
Last week, Madrid sold Argentine defender Gabriel Heinze to Marseille and on Tuesday another full-back, veteran Michel Salgado, left the club after 10 years at the Bernabeu.
The 33-year-old right-back, who joined Madrid from Celta Vigo in 1999, has been released by mutual consent despite having one year remaining on his current deal.
"Real Madrid would like to thank Michel for his commitment and behavior during 10 consecutive years of exemplary service with the club," said a statement on Madrid's official Web site.
Salgado enjoyed a great deal of success during his decade with Real, winning four Primera Liga and two Champions League titles among other trophies.