NEW YORK — Serena Williams’ serve was broken for the first time at this year’s U.S. Open. Twice, in fact. She also dropped a set for the first time in the tournament, pushed to the brink by Simona Halep in the quarterfinals.

In a match filled with fantastic shotmaking and enthralling exchanges Wednesday night, neither player budged until Williams righted herself in the third set to emerge with a 6-2, 4-6, 6-3 victory to return to the semifinals.

The No. 5 Halep, the 2014 French Open runner-up, was the first seeded player Williams faced in the draw.

“I’m glad I got tested,” Williams said. “Her level really picked up in the second but I had some opportunities that I didn’t take. So what I gather from that is I really could have played better in that second set and maybe had an opportunity to win in straights. If anything that’s the biggest silver lining I take.”

Halep staved off all 12 break points held by Williams in the second set and forced a third.

“I wasn’t very happy about that but I tried not to let that get me down,” Williams said about all the chances she let slip away. “I tried to stay positive and I knew that if I did, I could just stay in the match.”

At the start of the third set, Halep held two break points at 15-40, but Williams came through to lead 1-0. Otherwise, Halep said, “The story of the match would have been different.”

Instead, Williams converted the only break chance she would get – or need – in the deciding set to go ahead 3-1, and was on her way.

She finished with 18 aces, a 50-20 edge in total winners and won the point on 26 of her 32 trips to the net.

Not bad for someone who entered the U.S. Open with questions about a sore right shoulder that began bothering her after she won Wimbledon in July.

“I don’t really like coming to the net, to be honest, but I’m good at the net, I guess,” Williams said. “I guess I’ve got to do what I’m good at.”

Her opponent Thursday will be 10th-seeded Karolina Pliskova of the Czech Republic, who beat the 34-year-old American’s older sister, Venus, in the fourth round, then eliminated 18-year-old Ana Konjuh of Croatia 6-2, 6-2 on Wednesday to reach the first major semifinal of her career.

MEN’S QUARTERFINALS

Andy Murray lost his way, seven consecutive games and, eventually, his riveting five-set U.S. Open quarterfinal against Kei Nishikori after a loud noise from a malfunctioning sound system interrupted a key point, resulting in a do-over.

Whether or not the gong-like sound, and chair umpire Marija Cicak’s let ruling was the reason that Nishikori wound up coming back to win 1-6, 6-4, 4-6, 6-1, 7-5, it surely will be what’s most remembered about the back-and-forth, four-hour match.

After all, Murray’s extended discussions with Cicak and another official about the unusual episode came during a stretch in which he dropped 12 of 14 points.

He went from a lead of two sets to one, plus a break point at 1-all, to ceding the fourth set and trailing 2-0 in the fifth.

“I could have won the match for sure,” said Murray, the No. 2 seed and 2012 champion at the U.S. Open.

Murray acknowledged a brief dip in play but preferred to focus on other reasons for allowing the sixth-seeded Nishikori to reach a Grand Slam semifinal for the first time since he was the U.S. Open runner-up two years ago.

The other quarterfinal between Stan Wawrinka and Juan del Porto was ongoing late Wednesday night.