It comes after both players completed two rounds Thursday following Wednesday’s rain-affected washout in Rome.
Federer, who came from behind to defeat Borna Coric of Croatia to reach the quarterfinals in his second match of the day, has withdrawn because of an injury to his right leg.
The Swiss, seeded third in the draw, was set to play No. 8 seed Stefanos Tsitsipas of Greece. Earlier Thursday, Federer had defeated Portugal’s Joao Sousa 6-4, 6-3 in the round of 32.
In total, Federer, a four-time runner-up in Rome, spent nearly four hours on court.
This was Federer’s first appearance in this event since skipping the clay court season in 2017 and 2018.
In the semifinals, Tsitsipas will face No. 2 seed Rafael Nadal, who defeated fellow Spaniard Fernando Verdasco 6-4, 6-0 on Friday.
Osaka: ‘Couldn’t really move my thumb’
With Osaka’s withdrawal, Kiki Bertens, who won the title in Madrid last week, advances to the semifinals where she will face either Johanna Konta or Marketa Vondrousova.
Osaka told reporters that she woke up Friday with pain and swelling in her right hand. She said she was kind of confused about the development because she didn’t feel anything wrong in her wins Thursday against Dominika Cibulkova of Slovakia in the round of 32 and Romania’s Mihaela Buzarnescu in the round of 16. Both of those scorelines were 6-3, 6-3.
“I woke up this morning and couldn’t really move my thumb,” Osaka told reporters Friday. “I tried to practice and grip my racquet but I couldn’t, and I kept feeling this pain when I tried to move my hand in different directions.
“Right now I’m really, not mad, but I’m kind of in between sad and disappointed because I really wanted to play my match today. For me, it was sort of a test to play against Kiki because she’s playing really well, and I wanted to see how well I could do today. Right now, I’m feeling kind of sad.”
This is the second time during the clay season that Osaka has withdrawn during a tournament. Last month, she pulled out in Stuttgart, Germany, because of an abdominal injury after reaching the semifinals.
“I would describe (this clay season) as ‘rocky,'” Osaka said. “But I mean, I can’t necessarily say it’s been ups and downs because if I think about it, it’s definitely been going up. Every match that I’ve played I’ve learned a lot. I’ve tried to take what I’ve learned into the next match, and I think I’ve done that well.
“But the injury part is definitely very annoying,” she continued. “For me, I feel like the ab thing could have been helped, but this one I don’t think I could have helped it because I don’t know what caused it. I don’t know why I have it. I feel there are preventable injuries and then there are ones where you kind of have to take it how it is.”
Osaka will retain the world No. 1 ranking heading into the French Open.