MELBOURNE, Australia (AP) — Serena Williams' dominating run at the majors ended in a painful loss to American teenager Sloane Stephens.

After the biggest victory of her life, the 19-year-old Stephens is headed to the semifinals of the Australian Open.

Williams hurt her back in the eighth game of the second set, slowing down her serve, restricting her movement and causing her obvious pain.

Stephens kept her composure, blocking out the injury issue on the opposite side of the net, and rallied for a 3-6, 7-5, 6-4 victory on Wednesday — by far the most significant in her seven Grand Slams.

The gravity of it didn't hit Stephens until she was warming down, and even then the victory had an unreal feeling.

"I was stretching, and I was like, 'I'm in the semis of a Grand Slam.' I was like, 'Whoa. It wasn't as hard as I thought.' But it's pretty cool," she said. "To be in the semis of a Grand Slam is definitely I say a good accomplishment. A lot of hard work."

It was Williams' first loss since Aug. 17, ending a run of 20 consecutive wins.

The 15-time major winner hadn't lost a match at a Grand Slam tournament since the French Open, where her first-round exit sparked her resurgence in the second half of 2012 that included titles at Wimbledon, the London Olympics, the U.S. Open and the WTA Championship.

For her part, Williams said the bad back was just another problem to contend with at a Grand Slam event that had been "absolutely" her worst for injuries. It started when she injured her ankle in the first round.

"I'm almost relieved that it's over because there's only so much I felt I could do," she said. "It's been a little difficult. I've been thrown a lot of (curve) balls these two weeks."

Williams was up a set and a break before Stephens settled in. In the eighth game of the second set, Williams was chasing a drop shot to the net when she appeared to hurt her back. She needed a medical timeout after the set, and then slowly started to regain the speed in her serve.

She said her back "just locked up" on her.

"I couldn't really rotate after that," she said. "It was a little painful, but it's OK."

There were times when she barely concealed the pain, and had to bend over or stretch out her back. Yet the thought of retiring from the match only crossed her mind "for a nanosecond."

It didn't mean she wasn't frustrated. Williams smashed her racket into the court in the third set, breaking the frame and then flinging it toward the chairs on the side of the court. She looked to the sky occasionally and yelled at herself.

The racket abuse cost her $1,500 in fines.

Azarenka, with her most famous fan sitting in the crowd wearing a shirt reminding her to keep calm, overcame some early jitters to beat Svetlana Kuznetsova 7-5, 6-1 in the earlier quarterfinal at Rod Laver Arena.

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.

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, Azarenka 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."

Williams' loss was a boost for Azarenka, who lost all five head-to-heads against the American in 2012 and is 1-11 in their career meetings.

In the men's quarterfinals, 17-time major winner Roger Federer was playing No. 7 Jo-Wilfried Tsonga in a night match for a spot in the semifinals against Murray.

The 25-year-old Murray had his service broken for only the second time while serving for the match. But he broke back immediately to clinch the quarterfinal victory.

"I'll watch a little bit but I won't watch the whole match," Murray said of the night quarterfinal, adding that he hoped "Roger and Jo play 4 to 5 hours if possible!"

Defending champion Novak Djokovic plays No. 4-seeded David Ferrer in the other semifinal.

On the other half of the women's draw, Maria Sharapova has conceded only nine games in five matches — a record in Australia — en route to a semifinal against 2011 French Open champion Li Na.