Sakkari came back to win 6-7 (2), 7-6 (6), 6-3 early Tuesday as Andreescu had trouble with her left leg that was taped by a trainer during a medical timeout in the third set. Andreescu limped around between points down the stretch and her leg buckled a few times.
The 3½-hour match ended at 2:13 a.m. local time. The previous women's record was a 1:48 a.m. finish for a first-round match in 2016 in which Madison Keys beat Alison Riske; three men's matches have wrapped up at 2:26 a.m.
"I hope you will not be late for work [today],'' Sakkari told those fans who stayed until the end. "Go get some sleep and I'll see you in two days.''
Both players' grunts reverberated off the thousands of unused blue seats in Arthur Ashe Stadium by the end. Fans who remained engaged in dueling first-name chants: "Ma-ri-a!'' and "Bi-an-ca!''
This was Andreescu's first loss in the main draw at Flushing Meadows. She beat Serena Williams in the final to win the title in her debut two years ago and missed the hard-court Grand Slam tournament in 2020 while sitting out the entire season with an injured knee.
Andreescu later said she wasn't sure what the specific injury was.
"At this point I really don't know, but I slid a couple of times, and I fell on my groin a little bit," she said after the match. "I hope it's nothing too serious but that affected me a little bit."
The 11th-seeded Bencic won the lengthy first-set tiebreaker, then took the second set in 43 minutes -- about 20 minutes longer than the tiebreaker lasted.
"The set was so even, so I think in the tiebreak it's always a little bit about luck," Bencic said.
Bencic was a semifinalist at the US Open in 2019, the last time she played. She also reached the quarterfinals in her debut in 2014.
Swiatek, the No. 7 seed from Poland who won last year's French Open, was the only women's player to reach the fourth round in every major this year.
Raducanu, 18, has gone all the way from the US Open qualifying rounds to the quarterfinals. She joins fellow teenager Leylah Fernandez in the women's final eight.
Raducanu reached the fourth round at Wimbledon and has gone a step further in the year's last Grand Slam tournament, becoming just the third women's qualifier to reach the US Open quarterfinals in the professional era.
Rogers jumped to a 2-0 lead before Raducanu won the next 11 games.
Raducanu will next face Bencic with a spot in the semifinals on the line.
"Belinda is a great player who's in great form, so I know I'm going to have to bring it on Wednesday," Raducanu said.
Information from The Associated Press was used in this report.