Nine days out from the French Open starting, the 20-times Grand Slam champion has suffered a leg injury that has forced him to withdraw in Rome.
Roger Federer has suffered a potentially significant leg injury just nine days out from the French Open and withdrawn from the Internazionali d'Italia.
The world number three had been due to face Stefanos Tsitsipas in the quarter-final in Rome on Friday.
A statement on the tournament's website said: "Roger Federer has just phoned the ATP supervisor and tournament director to announce his retirement due to a problem with his right leg."
Federer, whose only French Open title came a decade ago, had been hoping to build up some momentum on clay courts ahead of his first appearance at Roland Garros since 2015.
The 37-year-old ended a three-year absence from clay-court tournaments when he featured at the Madrid Open last week, reaching the quarter-finals before being ousted by Dominic Thiem.
Federer: "I hope to be back next year"
He had been handed a first-round bye in Rome and, after all of Wednesday's play was postponed due to heavy rain in the Italian capital, Federer had to play twice on Thursday.
The Swiss beat Joao Sousa in straight sets before saving two match points against Borna Coric and eventually advancing in a tense tie-break in the decider.
That contest, which lasted two hours and 31 minutes, may have taken its toll as Federer announced he was unable to face Tsitsipas.
"I am disappointed that I will not be able to compete today," he said in quotes published on the tournament's Twitter page.
"Rome has always been one of my favourite cities to visit and I hope to be back next year."