Roger Federer, a 20-time Grand Slam singles champion, will retire from top-level tennis after the Laver Cup in London later this month.

Swiss Federer, 41, has not played since Wimbledon 2021, after which he had a third knee operation.

“My body’s message to me lately has been clear,” Federer said.

“I have played more than 1,500 matches over 24 years. Now I must recognise when it is time to end my competitive career.”

He added: “To the game of tennis, I love you and will never leave you.”

Federer has struggled with a knee problem for the past three years that has restricted him to only three of the 11 Grand Slams staged since the start of 2020.

He has not played a competitive match since losing to Hubert Hurkacz in the quarter-finals at Wimbledon last summer.

He subsequently announced he needed more surgery on his knee having previously had two operations in 2020.

Only Spain’s Rafael Nadal, with 22 majors, and Serbia’s Novak Djokovic, with 21, have more men’s Grand Slam singles titles than Federer.