She told reporters that she cannot serve because of the injury.
Williams was making her return to the Grand Slam circuit at Roland Garros in Paris. She beat Kristyna Pliskova before eliminating No. 17 Ash Barty and knocking out No. 11 Julia Goerges.
“You always live to fight for another chance,” Williams posted Monday morning on Instagram. “I’ve done a lot of fighting and this is just the beginning. Thank you a for the support. I love you.”
Williams was due to face Sharapova in a round of 16 matchup Monday on Court Philippe-Chatier. She was also on a quest to win her 24th Grand Slam.
“I’m beyond disappointed,” Williams said in a news conference. “I gave up so much from time with my daughter and time with my family all for this moment. So it’s really difficult to be in this situation.”
Williams said she started to feel discomfort during a doubles match Sunday. She teamed up with sister Venus Williams in a three-set loss to Maria Jose Martinez Sanchez and Andreja Klepac.
“It’s very difficult because I love playing Maria,” Serena Williams said. “It’s a match I always get up for. It’s extremely disappointing but I made a promise to myself that if I’m not at least 50 percent, I shouldn’t play.”