Two-time champion Venus Williams was pushed all the way by world number 135 Viktoria Kuzmova before reaching the second round of the US Open.
The 37-year-old American took her second match point on teenager Kuzmova's serve to win 6-3 3-6 6-2.
Williams has seven Grand Slam singles titles, while Kuzmova was making her main-draw debut at tour level.
Meantime, two-time finalist Caroline Wozniacki beat Mihaela Buzarnescu 6-1 7-5 to reach round two.
The Dane will face Russian Ekaterina Makarova next.
"I didn't do a lot wrong, she just just stepped it up," said Williams, who is aiming for her first major since 2008 and plays France's Oceane Dodin on Wednesday.
Williams, who has not won the title at Flushing Meadows since 2001, reached her second Slam final of 2017 when she lost to Garbine Muguruza at Wimbledon earlier this year.
Victory would make her the oldest female Grand Slam champion in the Open era, and could see her return to top of the world rankings for the first time since July 2002.
Williams is one of seven women left in the draw who could reach top spot, with British number one Johanna Konta's chance disappearing when she suffered a shock defeat by Serbia's Aleksandra Krunic.
"I just want to win, and if you win you get the ranking. Winning is all I want to do," added Williams.