Federer, a four-time Rome finalist, had been due to meet Greek eighth seed Stefanos Tsitsipas for a place in the semi-finals.
"I am disappointed that I will not be able to compete today," said Federer.
"I am not 100 percent 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."
Federer had been on court nearly four hours on Thursday as competitors played two matches after rain delays midweek.
The 37-year-old saved two match points to win through 2-6, 6-4, 7-6 (9/7) against Borna Coric to advance to the quarter-finals after earlier easing to a straight sets win over Portgual's Joaa Suosa.
The former world number one had been a late addition to the Rome tournament as he sought clay court practice ahead of his bid to add to his lone French Open title in 2009.
(This story has not been edited by Business Standard staff and is auto-generated from a syndicated feed.)