The Spanish football club has struck a deal with Liverpool to bring the full-back in ahead of the Club World Cup in the US this summer.
He will play for Real Madrid C.F. for the "next six seasons" from June 1, 2025, until June 30, 2031.
A statement by Real Madrid C.F. said: "Real Madrid C. F. and Liverpool FC have reached an agreement to sign Trent Alexander-Arnold for the next six seasons, from June 1, 2025 to June 30, 2031.
"The 26-year-old England international joins the club after winning nine trophies with Liverpool: Champions League (1), Club World Cup (1), Uefa Super Cup (1), Premier League (2), FA Cup (1), League Cup (2), and Community Shield (1).
"Alexander-Arnold, who has spent his entire playing career at Liverpool, has been a full international since 2018 with England, playing in two World Cups (2018 and 2022) and one European Championship (2024).
"On an individual level, he has been included once in the FIFA FIFPro World XI (2020), twice in the UEFA Champions League team of the season (2018/19 and 2021/22) and three times in the Premier League dream team (2018/19, 2019/20 and 2021/22). He was also voted the best young player of the Premier League 2019/20.
"Alexander-Arnold will be playing for Real Madrid in the Club World Cup, which will be held in the United States from June 14."
It was reported earlier in May that the player - who said he "never felt so loved" during Liverpool's Premier League match against Crystal Palace last weekend - would be leaving the Reds after 20 years.
Speaking at Liverpool's Anfield stadium after the club drew 1-1 with Crystal Palace, Alexander-Arnold told Sky Sports: "There wasn’t a day, minute, second that I didn’t think about the team. Twenty years is a very long time, but I’ve loved every single minute of it. The ups and the downs.
“It’s been an honour and privilege to be part of.
“I’ll remember this day. It’s very special for me. It goes down as the best day of my life.”