MADRID (AP) — Toni Kroos will retire from soccer after trying to give Real Madrid yet another Champions League trophy and lead Germany to the European Championship title at home.

The 34-year-old German midfielder said Tuesday it was a tough decision, but that the timing felt “somehow perfect."

“I always wanted to leave at the peak of my abilities and I know, and from a lot of examples you see, that it isn’t easy, that you can miss that point in time very quickly,” Kroos said on a podcast he hosts with his brother.

“I never wanted to have the feeling at the end that the club, the fans, the people around me would have to tell me, ‘That’s enough,’ or that I’d spend another two or three years sitting on the bench.”

Madrid thanked Kroos and hailed his achievements with the team.

“Real Madrid would like to express its gratitude and affection to Toni Kroos, a player who will go down in Real Madrid history as one of our club and international football’s greatest legends,” the club said.

Kroos was a World Cup champion with Germany in 2014 in Brazil, and had a successful career with Bayern Munich as well, helping it win one Champions League and three German league titles.

Madrid will face Borussia Dortmund in the Champions League final on June 1 in London. His European trophies with Madrid came in 2016, 2017, 2018 and 2022. He won the Champions League with Bayern in 2013.

Kroos has been with Madrid since 2014, helping it win 22 titles, including four European Cups and four Spanish leagues. He made 463 appearances with the club, which called the midfielder “a key player in one of the most successful periods of Real Madrid’s 122-year history.”

“Toni Kroos is one of the great players in Real Madrid history and this club will always be his home,” club president Florentino Pérez said.

Madrid said Kroos will remain forever in the hearts of every fan “thanks to his mastery of the game and the fact he has given his all for our jersey, a steadfast example of the values of Real Madrid.”

Kroos' contract with Madrid was expiring at the end of this season and the club and the player had reportedly been negotiating an extension.

Kroos said in February he agreed to play for Germany at Euro 2024 after a request from coach Julian Nagelsmann. He has not played for for the national team in almost three years, since Germany’s loss to England in the second round of the last European Championship.

Kroos was named last week in Germany's preliminary squad for the tournament.

He had said a few months ago that he didn't know what would happen next season.

"I thought it over for a really long time and in the last few days I’ve reached the conclusion that this season, this wonderful season, the 10th season with Real, is also my last season with Real," Kroos said Tuesday.

"And anyone who has paid attention when listening to me over the last few months or years will have heard the sentence at one time or other that the only option for me was to end my career at Real Madrid. And if you can put one and one together, you know that my last season with Real means it's over this summer. No more Real, no more football."

___

AP Sports Writer James Ellingworth contributed to this report.

___

AP soccer: https://apnews.com/hub/soccer