Per ESPN.com, Federer said on Friday:
"I am disappointed that I will not be able to compete today.
"I am not 100 per cent physically and, after consultation with my team, it was determined that I not play. Rome has always been one of my favourite cities to visit, and I hope to be back next year."
Due to a backlog of fixtures after rain interrupted play on Wednesday, Federer was one of several players forced to play twice on Thursday as he beat Joao Sousa and Borna Coric.
His three-set match with Coric lasted just shy of four hours, and the Swiss maestro indicated after the match that he injured his leg after slipping on the baseline.
Federer was due to play Stefanos Tsitsipas in the quarter-final on Friday.
He is not the only notable player to withdraw having played twice yesterday, per tennis writer Ben Rothenberg:
Christopher Clarey of the New York Times questioned his decision to appear in Rome with Roland Garros looming:
Christopher Clarey @christophclarey
With the leg injury, have to wonder if it was the right call for Federer to add Rome to his clay-court schedule. French Open starts in 10 days. Will need to be fully fit to make a deep run. Got in five matches total before Roland Garros: 3 in Madrid, 2 in Rome (all in one day)
Federer has not appeared at the French Open since 2015. A back injury kept him out of it the following year, while in the last two years he has skipped the clay season entirely to keep fresh for Wimbledon.
The 37-year-old would have had a difficult enough time winning at Roland Garros ahead of Rafael Nadal, who has won there 11 times since 2005.
His task will be even more daunting if he's not fully fit, should he be able to feature in the tournament at all following his injury.