Serena Williams kept alive her hopes of a record-equalling 24th Grand Slam singles title with a 4-6 6-3 6-2 win over Tsvetana Pironkova in the US Open quarter-finals.
The American six-time champion, 38, struggled early on with the variety of shots from the unranked player who was in her first tournament in three years.
The Bulgarian, 32, broke in the fifth game en route to taking the first set.
Pironkova tired as Williams took the second and broke twice in the third.
The veteran will now play former world number one Victoria Azarenka or Belgian 16th seed Elise Mertens.
Williams said she could not afford another sluggish start if she is to reach her fifth Grand Slam final in three years.
"I was feeling it a little in my legs and an hour in, for some reason, I got more energy. I can't do that if I want to keep winning," said the American, who last won the US Open in 2014.
"I play again on Thursday. I am used to playing back to back to back, but I need to figure out how to start a little bit faster.
"I keep fighting, I never give up. You've got to keep going."
Williams takes advantage of tiring Pironkova
Like in her third-round match against Sloane Stephens, Williams made a slow start which Pironkova exploited on longer rallies and with her dangerous sliced forehand. The break seemed inevitable and came in the fifth game when the Bulgarian - a semi-finalist at Wimbledon in 2010 - hit a great double-handed backhand winner.
There were signs Williams was improving towards the end of that set, and although she did go a break down early in the second set, the American levelled immediately and then had break point in the following Pironkova service game.
That was saved, but the former world number 31 lost her serve again when she was out-thought and outplayed in the eighth game, decided by an error following a phenomenal 26-shot rally. Her more decorated opponent raised her arm and let out a cry of celebration and relief inside the near empty Arthur Ashe Stadium.
By this stage, Pironkova's points won on her first and second serves had dropped from 87% and 70%, respectively, down to 47% and 55% and the unforced errors were up from five to 10. It seemed the exertions of the near three-hour three-set match against Alize Cornet in the previous round were beginning to take their toll.
Williams also experienced a three-set contest in her last-16 match, but her stamina appeared to increase as this match went on. She broke twice more in the third set and booked her place in the semi-final with a game to love, which contained her 20th ace.
'You play a match, go home and you're still changing diapers'
Defeat brought an end to the fairytale return for the player from Plovdiv, who following a shoulder injury in 2017 decided to start a family and take time out from the sport.
Pironkova chose the Flushing Meadows tournament to mark her comeback and entered at the first-round stage courtesy of a protected ranking of 123rd - the position she occupied when she last played.
Williams paid tribute to the Bulgarian for reaching the last eight in her first tournament since 2017.
"It shows me how tough mums are," the former champion said. "Whenever you can birth a baby, honestly you can do anything. We saw that today, she played unbelievable.
"I could barely win a match when I came back, so she's incredible. Her baby has to be younger than mine - you play a match, go home and you're still changing diapers, it's like a double life."