NEW YORK — Madison Keys slept until almost 11 a.m. Monday. She didn’t arrive at Arthur Ashe Stadium until 6:30 p.m., knowing that a late night on court awaited her.

Keys and fellow American Alison Riske didn’t envision it going quite so late. Their first-round U.S. Open match didn’t end until 1:48 a.m. Tuesday.

It was the latest finish for a women’s match in tournament history — typically the women play first and the men second in the night session, so six men’s matches have ended later.

The first night matches of the U.S. Open always start later because of the opening ceremony, but more often than not they’re routs with a top player facing an unseeded opponent.

But on Monday, No. 1 Novak Djokovic was pushed to four sets, then Riske and Keys went three.

The eighth-seeded Keys rallied from down a set and a break to win 4-6, 7-6 (5), 6-2 in 2 hours, 26 minutes.

Both players said they weren’t particularly aware on court of how late it was.

“Now that I’m a part of it, yay,” Keys said of setting a record. “Let’s not try to break it.”

Asked if she’s a night owl, Riske said simply: “No.”

Keys, meanwhile, is definitely not a morning person.

“This time of morning, I am,” she said in her on-court interview shortly before 2 a.m. “At 6 a.m., 7 a.m., I’m not a good person.”

The 60th-ranked Riske had two points on her serve at 5-4 in the second-set tiebreaker to try to close out the match, but Keys won them both and clinched the set on the next point.

Riske has lost 10 straight Grand Slam matches. She’s 2-16 against top-10 opponents, though one of the victories came against Petra Kvitova as Riske reached the round of 16 at the 2013 U.S. Open.

“It’s only a matter of time that things start turning my way,” she said.

Keys took a medical timeout in the second set to have a trainer work on her right shoulder. She said it was just soreness and she didn’t expect it to be an issue going forward.

Keys hasn’t lost in the first round at a major since the 2014 French Open. The 21-year-old is coming off a run to the Olympic semifinals, but she pulled out of the hard-court tuneup at New Haven because of a neck injury.