She was playing at her first Grand Slam and trailing 6-1 5-1 to a seed - but then Varvava Gracheva managed the impossible.
The Russian 20-year-old saved four match points as she climbed spectacularly out of a hole to beat Kristina Mladenovic 1-6 7-6 (7-2) 6-0 in the US Open second round.
"It is definitely the most painful match and loss I have had in my career," France's Mladenovic said.
"I just collapsed."
Gracheva will face eighth seed Petra Martic next after the Croat beat Ukraine's Katerina Bondarenko 6-3 6-4.
Meanwhile, sixth seed Petra Kvitova overcame an early setback to advance.