Eighth seed Pegula was aiming to secure a double celebration for the New York crowd by following fellow American Frances Tiafoe into the singles semi-finals.
The 28-year-old has been one of the most consistent players on the WTA Tour this year, but faced a player who has dominated this season and is looking for a seventh title of 2022.
After a decent start resulted in her breaking for a 3-2 lead, Pegula missed a swinging volley to allow Swiatek to level and the home hope’s confidence took a nosedive in the rest of the opening set.
French Open champion Swiatek, cheered on by legendary American skier Lindsey Vonn from her box, seized the opportunity and won 16 of the final 18 points to take the lead.
Amid a slightly subdued atmosphere in the opening match of Wednesday’s night session, both players continued to struggle in their service games.
Four successive breaks opened the second set before Swiatek, who had dropped only one set in the tournament coming into the match, took advantage of another poor game from Pegula for a 4-3 lead.
Pegula showed her annoyance by whacking a loose ball into the stands. The release helped her hit straight back to level at 4-4, as did mistakes from Swiatek, who has spoken out about the women using a different ball to the men and changed her racquet several times during the match.
The two-time major champion was not hitting as cleanly and consistently as she did in a remarkable 37-match winning streak earlier this year.
A huge slice of luck came Swiatek’s way with a net-cord on break point for 4-5 but twice she could not serve out the match as Pegula broke for the 10th time in 12 games.
That led to a tie-break which also started nervily. Swiatek stepped in to pump a backhand winner down the line for a mini-break at 5-4, brought up a match point with another and finally clinched victory when Pegula dragged a backhand wide.
“I should be positive. At the same time I’m like it’s three quarter-finals. Sorry, but it sucks. It sucks,” said Pegula, who lost to Swiatek in the French Open quarter-finals and previous world number one Ashleigh Barty in the Australian Open last eight.
“I wish I could have done it here at my home Slam, but I guess not.”