Italian Open officials did not elaborate further on the reasons for Sharapova's Rome exit but the 26-year-old said on her Twitter account she was sick.
"I'm sorry for having to withdraw from the tournament this morning. Didn't recover after being sick last week and it got me again last night," Sharapova tweeted.
"It really is one of my favourites tournaments during the year and I can't wait to be back next year."
Sharapova showed no signs of any physical problems in easing through her third round match against Sloane Stephens on Thursday, the Russian winning 6-2 6-1.
The news comes two days after Andy Murray withdrew from the men’s tournament with a hip problem.
Sharapova is set to defend her French Open title later this month.
Top seed Serena Williams is now the overwhelming favourite to lift the title after demolishing Spain's Carla Suarez Navarro 6-2 6-0, stretching her winning run to 22 matches.
"I guess this is the best period in my career but I don't really think about it," the American said.
Former women's champion Jelena Jankovic was beaten by Romanian qualifier Simona Halep 4-6 6-0 7-5, while third seed Victoria Azarenka of Belarus beat Australia's Samantha Stosur 6-4 1-6 6-3
Rome Masters (women) quarter-final results:
3-Victoria Azarenka (Belarus) beat 9-Samantha Stosur (Australia) 6-4 1-6 6-3
1-Serena Williams (U.S.) beat Carla Suarez Navarro (Spain) 6-2 6-0
7-Sara Errani (Italy) beat 2-Maria Sharapova (Russia)WO
Simona Halep (Romania) beat Jelena Jankovic (Serbia) 4-6 6-0 7-5
Rome Masters (women) round three results:
9-Samantha Stosur (Australia) beat 8-Petra Kvitova (Czech Republic) 7-5 2-6 6-1
2-Maria Sharapova (Russia) beat 16-Sloane Stephens (U.S.) 6-2 6-1
3-Victoria Azarenka (Belarus) beat Ayumi Morita (Japan) 6-1 2-0 (Morita retired)
1-Serena Williams (U.S.) beat 14-Dominika Cibulkova (Slovakia) 6-0 6-1
Simona Halep (Romania) beat 13-Roberta Vinci (Italy) 6-4 6-2
Carla Suarez Navarro (Spain) beat Lourdes Dominguez Lino (Spain) 6-2 6-3
7-Sara Errani (Italy) beat 12-Maria Kirilenko (Russia) 6-3 2-0 (Kirilenko retired)
Jelena Jankovic (Serbia) beat 5-Li Na (China) 7-6(2) 7-5