Cristiano Ronaldo is leaving Real Madrid to join Italian club Juventus in a move expected to benefit the Portugal forward’s tax return.

Juventus said Tuesday it paid 112 million euros ($131.5 million) for Ronaldo, who signed a four-year deal with the Serie A champions.

The move brings an end to a hugely successful nine-year spell in Spain, and takes him further away from a tax fraud case that might end up costing the Portugal forward more than $20 million in fines.

“These years with Real Madrid and in this city of Madrid have been possibly the happiest of my life,” Ronaldo wrote in an open letter. “My only feeling is of an enormous gratitude for this club, for these fans and for this city. I can only thank them all for the love and affection I have received.

“But I think the time has come to start a new phase in my life and that is why I have asked the club to accept my transfer. I feel that it is time, and I ask everyone, especially our fans, to please understand me.”

Ronaldo joined Real Madrid in 2009 from Manchester United and was the Spanish club’s all-time leading scorer with 451 goals in 438 matches. He helped the club win four Champions League titles — beating Juventus in the final in 2017 — and won the league and cup twice each.

He has scored a record 120 Champions League goals, 105 of them since moving to Madrid — 12 more than Juventus managed in that period.

But he was unhappy with the way the tax authorities treated him in Spain. Ronaldo, along with several other top players in the country, has been accused of tax fraud, with authorities saying the government was defrauded of 14.7 million euros ($17 million) from 2011-14. Unconfirmed media reports last month said Ronaldo had agreed to pay a fine of 18.8 million euros ($22 million).

In Italy, a new law caps tax on income generated from abroad at 100,000 euros ($117,000) per year for residents who have paid their taxes in other countries for at least nine of the last 10 years.

Other players targeted by Spanish tax authorities in recent years include Lionel Messi, Javier Mascherano and Luka Modric. Former Real Madrid coach Jose Mourinho, now at Manchester United, was also investigated.

Ronaldo is currently on vacation in Greece following Portugal’s elimination from the World Cup. Juventus president Andrea Agnelli flew out Tuesday to meet the 33-year-old forward.

“Real Madrid wants to express its gratitude to a player who has proven to be the best in the world and who has marked one of the greatest eras in the history of our club and of world soccer,” Real Madrid said in a statement.

“In addition to the titles he won, Cristiano Ronaldo has been an example of dedication, work, responsibility, talent and determination,” Madrid added. “For Real Madrid, Cristiano Ronaldo will always be one of its greatest symbols and a unique reference for the next generations. Real Madrid will always be his home.”

Ronaldo signed a five-year deal with Madrid in 2016, saying he wanted to end his career at the club. But he has also publicly expressed his discontentment about being jeered at times by some Madrid fans at the Santiago Bernabeu Stadium.

Ronaldo was also moved by the Juventus fans for giving him a standing ovation after he scored a spectacular goal against the Italian club at the Allianz Stadium in the Champions League quarterfinals last season.

“I gave a lot of thought to this and I know that the time has come for a new era,” Ronaldo said. “I’m leaving, but this jersey, this shield and the Santiago Bernabeu will always feel as something that is mine wherever I go.”

The signing broke the Serie A record, which Juventus set two years ago when it paid Napoli 90 million euros (then $99 million) for Gonzalo Higuain.

Ronaldo made his debut for Sporting Lisbon when he was 17. His crossover dribble was already famous when Alex Ferguson brought him to Manchester United ahead of the 2003-04 season and gave him the No. 7 shirt of the recently departed David Beckham.

He spent six seasons in England, winning three Premier League titles, one Champions League title and one FA Cup.

Ronaldo led Portugal to its first major title at the European Championship two years ago in France. He helped the Portuguese team reach the semifinals in his first World Cup in 2006.

Portugal was eliminated by Uruguay in the round of 16 of this year’s tournament in Russia. Ronaldo scored four goals to take his tally to 85 for his country and break Ferenc Puskas’ record as Europe’s all-time leading international scorer.