In a Facebook post that broke the hearts of his fans around the world, Roger Federer announced that he will miss Rio Olympics and the rest of the ATP season in order to fully recover from his injury troubles this year.

Federer, who missed the French Open earlier this year after 65 consecutive Grand Slams, has represented Switzerland in four Olympic Games starting from Sydney 2016. That run will come to an end in 2016.

Federer, who turns 35 in August, underwent knee surgery in February before missing May's French Open with a back problem, and the Swiss star said he was calling time on his 2016 season to focus on his recovery.

"I'm extremely disappointed to announce that I will not be able to represent Switzerland at the Olympic Games in Rio and that I will also miss the remainder of the season," Federer said on his Facebook page.

Federer, who suffered a heartbreaking five-set loss to Milos Raonic in the semi-finals at Wimbledon just over a fortnight ago, is enduring the toughest year of his career.

He has also failed to add to his 88 titles this year, his longest drought since 2000.

An Olympic singles gold medal is the lone major prize to escape Federer in his record-breaking career, having finished runner-up to Andy Murray at London 2012.

However, the former world number one insisted he would channel his focus on making a full recovery for next season, after recently announcing he would play in the Hopman Cup ahead of the Australian Open.

He added: "I am as motivated as ever and plan to put all my energy towards coming back strong, healthy and in shape to play attacking tennis in 2017."

Get well soon, Roger!