Roger Federer’s career-final on-court appearance last month at the Laver Cup came close to being cancelled, with coach Ivan Ljubicic spilling the painful details.

The Croat told Spain’s Puntodebreak that the 41-year-old’s fitness was dicey until before the 20-time Grand Slam winner finally stepped onto court for doubles alongside Rafael Nadal.

The Swiss icon had been through three knee procedures and had been having troubles in training prior to the event in London run by his management company.

The pair lost the match in the Europe v World competition with a tearful goodbye for Federer to his 24-year career.

“We didn’t know until the last moment if he was going to be able to play doubles with Rafa, which was what he wanted to do,” Ljubicic told the website.

“And personally I’m very happy that he was able to finish his career on the court.”

Former world No. 3 Ljubicic, who worked with Federer for six years, said the left knee was always going to be a weak point in the final effort.,

“The knee couldn’t hold the load. He couldn’t stand what it was like to play five sets and come back the next day and play more. It was not a particular movement.

“It’s like driving a car and there comes a time when you cover a certain number of kilometres and it doesn’t go anymore. 

“Although I expected it and knew it was going to come, sooner rather than later, it is something that ends up hitting you.”

Main photo:- Roger Federer and Rafael Nadal of Team Europe during the doubles Day One Laver Cup London, England by Clive Brunskill/Getty Images/Laver Cup