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

In a match filled with fantastic shotmaking and enthralling exchanges, neither player budged until Williams righted herself in the third set to emerge with a 6-2, 4-6, 6-3 victory over Halep on Wednesday night to get back to the semifinals at Flushing Meadows.

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.”

Right 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.”

She is bidding for her seventh title at Flushing Meadows and 23rd overall at a major tournament — both would be records for the Open era, which dates to 1968.

A year ago in the semifinals, Williams’ attempt to finish off a calendar-year Grand Slam ended with a stunning loss to unseeded Roberta Vinci of Italy.

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.

As good as Williams’ serve is, it’s Pliskova who leads the tour in aces in 2016.

Williams, seeded No. 1, had held serve in 37 consecutive games over the past two weeks until Halep broke to get within 3-2 in the opening set. Still, Williams breezed through the rest of that set.

Then came a pivotal segment of the second. Instead of trailing 3-0, which was nearly the case, Halep wound up ahead 3-1.

First, she hung in there to erase seven break points — yes, 7! — in one game to hold for 1-all. Then she got to 15-40 on Williams’ serve, creating two break points that Williams made vanish with three aces in a row, at 117, 109 and 122 mph.

Escape complete? Not quite. Then came two more break points, the last created by a huge Halep backhand that Williams tried in vain to get back with a desperation lefty shot. Williams’ second double-fault of the game followed, and Halep would need to save five more break points before finally cashing in on her fifth set point to send the match to set No. 3.

That’s where Williams once again asserted herself, as she so often does.

“It was tough. Is tough,” Halep said. “I’m a little bit sad.”

In Thursday’s other semifinal, No. 2 Angelique Kerber plays two-time U.S. Open runner-up Caroline Wozniacki. Kerber has a chance to end Williams’ record-tying string of 186 consecutive weeks at No. 1 in the WTA rankings.

As Halep can attest, though, Williams does not relinquish anything easily.


Follow Howard Fendrich on Twitter at http://twitter.com/HowardFendrich