Williams appeared to hurt her lower back while attempting to pull up short of the net during the eighth game of the second set. She called for a trainer after the ninth game with the score 5-4 and on serve.
At 2-1 and on the way to a changeover in the third set, Williams smashed her racket angrily on the court then threw it toward her chair.
Stephens next will play defending champion Victoria Azarenka, who overcame some early jitters to beat Svetlana Kuznetsova 7-5, 6-1 and advance to the semifinals.
After dropping serve in a long fourth game that went to deuce 10 times, Azarenka recovered to dominate the rest of the match against Kuznetsova, a two-time major winner who was floating dangerously in the draw with a No. 75 ranking as she recovers from a knee injury.
Azarenka’s American rapper friend, Redfoo, returned from a concert in Malaysia to attend Wednesday’s quarterfinal match.
Wearing a red sleeveless T-shirt that read “Keep Calm and Bring Out the Bottles,” the name of his next single, Redfoo stood, clapped and yelled, “Come on, Vika!” during the tight first set.
Asked if it helped to have her No. 1 fan wearing a “Keep Calm” logo, Azareka said, “I was looking more at the part that says, ‘Bring out the bottles.’”
Of her game, she added, “I’m just glad I could produce my good tennis when it was needed.”
In the men’s quarterfinals, 17-time major winner Roger Federer was playing No. 7 Jo-Wilfried Tsonga in a night match and U.S. Open champion Andy Murray was to meet Jeremy Chardy of France.
Novak Djokovic is already through the semifinals after his 6-1, 4-6, 6-1, 6-4 win over fifth-seeded Tomas Berdych on Tuesday night.
The 2-hour, 31-minute victory took exactly half the time of his five-set, fourth-round win two nights previously against Stanislas Wawrinka.
“It was a great performance. I was hoping to have a shorter match … just not to go over 5 hours,” Djokovic said, in a comparatively subdued mood Tuesday after a considerably more routine victory. “It’s always going to be tough against Tomas; he’s an established player. He has a big game, big serve. He can compete against anyone on any surface.”
In the semifinals, Djokovic will meet No. 4-seeded David Ferrer.