Los Merengues have long been chasing the Spanish international, but the deal nearly collapsed after Liverpool asked Real to pay £30 million for Alonso's services.
Alonso himself publicly announced that he would love to join Real before coach Manuel Pellegrini put pressure on the Spanish club president Florentino Perez to conclude the purchase.
"Liverpool Football Club this evening confirmed they had reached agreement for the sale of Xabi Alonso to Real Madrid, subject only to a medical," read a statement on the Red's website.
The statement added that the terms of the deal will remain confidential and undisclosed. However, Spanish reports claimed that the deal could be done for around £25 million.
The 27-year-old will be Real's sixth major purchase of the summer, after they brought in Kaka, Cristiano Ronaldo, Karim Benzema, Raul Albiol and Alvaro Arbeloa.
Alonso moved to Liverpool from Real Sociedad in 2004. He helped the club win the UEFA Champions League in his first season with the club.
نرشح لكم
توخيل: 30 دقيقة بعشرة لاعبين كانت طويلة أمام إسبانيا.. واستحققنا الفوز
دوري الأمم – العقدة مستمرة.. بلجيكا تكتسح إيطاليا برباعية وتتأهل رفقة فرنسا
دوري الأمم الأوروبية - نهاية اللاهزيمة.. إنجلترا تهزم إسبانيا في عقر دارها بثلاثية
إسبوزيتو يتخطى عدد أهداف توتي مع إيطاليا
رونالدينيو: 45 دقيقة مرت كأنها لحظات.. وكرة القدم أفضل شيء حدث لي
تقرير: لصعوبة ضم بالدي.. مانشستر يونايتد يوجه أنظاره إلى مدافع برينتفورد
بمشاركة رونالدينيو بعد 11 عاما.. رافينا يفوز بدربي الإقليم على فورلي
كلوب يهاجم إنفانتينو قبل مواجهة هولندا










في الجول يكشف طاقم حكام مباراة الأهلي ضد بيراميدز بالكامل
وصول بعثة منتخب مصر إلى مالاوي