INDIAN WELLS, Calif. — For the first three games, Serena Williams was in a deep, irresistible groove: pounding serves and ground strokes as Garbiñe Muguruza watched the winners zoom by.

Who could have known, as Williams took a quick 3-0 lead, that she would not win another game on Sunday?

With Williams visibly hampered, increasingly slow on her feet and unable to hit serves at full power, Muguruza reeled off seven straight games. Muguruza was up to a 6-3, 1-0 lead before Williams walked to her chair instead of changing ends, sitting down heavily and then retiring from this third-round match at the BNP Paribas Open.

The WTA Tour announced that the reason for Williams’s retirement was a “viral illness.”

“Before the match, I did not feel great, and then it just got worse with every second: extreme dizziness and extreme fatigue,” Williams said in a statement released by the tournament. “By the score, it might have looked like I started well, but I was not feeling at all well physically.”