Roger Federer will retire from professional tennis following next week’s Laver Cup.

Federer announced the news by posting a letter on Twitter, alongside an audio recording of him reading the note.

“As many of you know, the past three years have presented me with challenges in the form of injuries and surgeries,” Federer said. “I have worked hard to return to full competitive form. But I also know my body’s capacities and limits, and its message to me lately has been clear.”

“Tennis has treated me more generously than I ever would have dreamt, and now I must recognize when it is time to end my competitive career,” he continued. “I will play more tennis, of course, but just not in Grand Slams or on the tour.”

Federer went on to reflect on his 24-year career, explaining how fortunate he feels to have played in front fans in over 40 different countries.

“The last 24 years on tour have been an incredible adventure,” he said. “While it sometimes feels like it went by in 24 hours, it has also been so deep and magical that it seems as it I’ve already lived a full lifetime. I have had the immense fortune to play in front of you in over 40 different countries. I have laughed and cried, felt joy and pain, and most of all I have felt incredibly alive. Through my travels, I have met many wonderful people who will remain friends for life, who consistently took time out of their busy schedules to come watch me play and cheer me on around the globe. Thank you.”

Federer, 41, will retire with 20 Grand Slam titles, which ranks third all time among men’s tennis players, behind Rafael Nadal (22) and Novak Djokovic (21). Over his 24-year career, Federer amassed 1,251 wins and 103 singles titles.