Cristiano Ronaldo is joining Juventus after the Italian club agreed a €100m (£88.3m) fee for the Portugal forward with Real Madrid.

The 33-year-old is ready for a new challenge after nine years at Real and asked the La Liga club to let him go. The player and his agent, Jorge Mendes, met the Juventus chairman, Andrea Agnelli, in Greece on Tuesday to discuss the final details of the deal. Ronaldo is signing a four-year contract with an annual salary of around €30m. In Italy clubs have to pay the same amount in tax, which takes the total cost of the transfer to €340m (€100m transfer fee plus €240m in salary and taxes).

Cristiano Ronaldo for €100m at 33? Indulgence or Juventus masterstroke? | Paolo Bandini Read more

“I only have feelings of enormous gratitude for this club and for this city,” Ronaldo wrote in an open letter to Real fans. “I have had nine absolutely wonderful years at the club.

“Real Madrid has conquered my heart, and that of my family, and that is why more than ever I want to say thank you: thank you to the club, the president, the directors, my colleagues, all the staff, doctors, physios and incredible people that make everything work.”

He finished his letter by saying: “Thanks to everyone and, of course, as I said that first time in our stadium nine years ago: Hala Madrid!”

Real also released a statement on Tuesday saying they had agreed to the transfer “at the will and the request of the player”. The statement added: “Real Madrid would like to express its gratitude to a player who has proved to be the best in the world and who has made this one of the most brilliant times in the history of our club.

“Beyond the titles he won during these nine years at the club Cristiano Ronaldo has also been an example of dedication, work, responsibility, talent and constant improvement.”

Quick guide Cristiano Ronaldo at Real Madrid Show Hide • 451 goals in 438 games

• Scored more than 40 goals in eight consecutive seasons

• Scored 69 goals in 2011-12 season

• First player to score 100 Champions League goals for one club

• Four Ballon d’Or awards (2013, 2014, 2016, 2017)

• Four Champions League titles (2014, 2016, 2017, 2018)

Photograph: Paul White/AP

Ronaldo joined Real Madrid in 2009 after six years at Manchester United. He won four Champions League titles with Real, two league championships, two Spanish Cups and three Fifa Club World Cups.

The World Cup Fiver: sign up and get our daily football email.

He also became Real’s record scorer with 451 goals in 438 games. While there he won four Ballons d’Or and three Golden Boots.

Real finished their statement by saying: “For Real Madrid Cristiano Ronaldo will always be one of our greatest symbols and a unique reference for our next generations. Real Madrid will always be your home.”

Transfer window 2018 – every summer deal from Europe's top five leagues Read more

Sergio Ramos, the Real captain, sent Ronaldo a message on Twitter thanking the Portuguese for everything he has done for the club since he joined in 2009. “Cristiano, your goals, your numbers and everything we’ve won together speak for themselves. You have earned a special place in the history of RealMadrid. As Madridistas we’ll remember you for ever. It’s been a pleasure to play alongside you. Big hug and good luck!”

Juventus’s Sami Khedira, who played with Ronaldo at Real Madrid before moving to Turin, said: “Welcome to Turin, Cristiano. We were great at Real Madrid and I can’t wait to work with you again. Today is a great day for Juventus.”