Safarova, the 13th seed, won 7-6 (7/3), 6-4 to progress to a first ever quarter-final at Roland Garros, where she will face Garbine Muguruza after the Spaniard saw off Flavia Pennetta.
Sharapova, who also won the clay-court Grand Slam event in 2012 and was the beaten finalist in 2013, had been forced to wait until Monday morning for her clash with Safarova, which had been postponed on Sunday due to the rain in the French capital.
But on a bright Paris morning the Russian second seed, who was looking to become the first woman to successfully defend the French Open title since Justine Henin in 2007, was punished for an erratic display from beginning to end.
Sharapova was broken in her second service game, and although she soon broke back, Safarova claimed the opening set in the tiebreak on Court Philippe Chatrier.
Breaks were again exchanged in the second set but Sharapova found herself serving to stay in the match at 5-4 down, and while she saved one match point she could not save the second that came her opponent's way.
"I had a few small openings but I wasn't able to keep up my level. She was more consistent and aggressive, created the angles and that was the difference," said Sharapova who had been battling a heavy cold all week.