British number one Johanna Konta has been knocked out of the US Open in the last 16 by Anastasija Sevastova.
The 13th seed lost 6-4 7-5 against the Latvian world number 48.
Konta fought back to 5-5 from 4-1 down in the second set and saved two match points, but was finally undone as Sevastova broke serve to win.
Sevastova, who retired in 2013 before making a comeback, will play Caroline Wozniacki in the quarter-finals.
Konta was bidding to become the first British woman in the quarter-finals in New York since Jo Durie in 1983.
She said: "I didn't play the tennis level that I maybe would have liked, but I competed the best I could.
"Right now I'm pretty tired," Konta told BBC Sport. "It is a very long season with the Olympics thrown in the mix.
"It was challenging but equally rewarding - it was a great experience to be part of Team GB.
"I've played a lot of very good matches and won a lot of them, so it's a good problem to have."
German second seed Angelique Kerber beat two-time Wimbledon champion Petra Kvitova 6-3 7-5 to keep alive her bid to become world number one.
The result means Serena Williams will have to reach the final and, if it's against Kerber, win the tournament to prevent the Australian Open winner taking top spot in the rankings.
Kerber will play Italian seventh seed Roberta Vinci for a place in the semi-finals. Vinci, the 2015 runner-up, overcame Lesia Tsurenko of Ukraine 7-6 (7-5) 6-2.
Konta out of sorts
Playing in the first match of the day on Flushing Meadows' showpiece Arthur Ashe court, Konta struggled to impose herself in tricky conditions with half the court in bright sunlight and the rest shaded by the arena's new roof.
Her serve - usually among her most potent weapons - failed to make much impression on the dogged Sevastova, delivering only one ace and a return of just 45% of the points when she landed with her first attempt.
Konta's game was also littered with mistakes. She made 34 unforced errors compared to the mere six she committed in her win over Belinda Bencic in the previous round.
It appears that a globe-trotting second half of the season - including a run to the last eight at the Rio Olympics - might be catching up with her.
The 25-year-old suffered an on-court collapse during her second-round victory at Flushing Meadows and indicated she may not have fully recovered.
"I'm sure there are some remnants of it but it's not the reason I lost," Konta said.
"It's an accumulation of things. I have played a lot of tennis, especially in this space of time.
"I think it was just managing my energy levels and managing what I had left in the tank and really maximising that.
"Unfortunately it wasn't enough to play the kind of tennis I wanted to play."
Sevastova made the faster start to both sets, going 3-0 up in the first and 4-1 clear in the second.
And at the climax of the match, the 26-year-old kept her volatile emotions in check to convert a third match point and secure her first appearance in the last eight of a Grand Slam.
Her run also includes an eye-catching second-round win over Spanish third seed Garbine Muguruza and makes her the first Latvian woman to make a Grand Slam quarter-final since Larisa Neiland at Wimbledon in 1994.
"I had a lot of injuries. I was depressed and it just wasn't fun anymore," said Sevastova as she explained why she took a 19-month absence from the sport from May 2013. "But now I'm back."
BBC tennis correspondent Russell Fuller
"It is an indication of Konta's extraordinary progress in the past 12 months that this fourth-round defeat comes as a surprise and a disappointment.
"Sevastova played a canny match by dragging Konta around the court with drop shots and slice - forcing the British number one to save two match points before a shanked forehand ended the contest.
"Konta was, though, a long away from her best. She experienced breathing difficulties and a racing heartbeat in her second-round match against Tsvetana Pironkova - the first sign that a long and successful season had started to take its toll."