Fifth seed Elina Svitolina had five match points saved before she eventually defeated Venus Williams 6-4 6-4 to reach the US Open third round.
The Ukrainian, 24, missed several opportunities to seal the win in a 17-minute ninth game of the second set.
She eventually secured victory when a forehand from 2000 and 2001 champion Williams, 39, went long.
Wimbledon semi-finalist Svitolina, who has reached the fourth round at Flushing Meadows in the past two years, will now play either Rebecca Peterson of Sweden or compatriot and 32nd seed Dayana Yastremska.
“It was an incredible match. We saw it was incredibly tough and only a few points divided the match,” said Svitolina.