Andre Agassi came through a dramatic encounter to beat Marcos Baghdatis in five sets at the US Open and so extend his career by at least one more match.
Agassi is playing in the US Open for the 21st year in a row
The 36-year-old, who retires after the event, upset the eighth seed 6-4 6-4 3-6 5-7 7-5 in the night match.
Agassi was superb in the first two sets but missed break points in the third and lost a 4-0 lead in the fourth.
With Baghdatis suffering cramp, Agassi recovered from a break down in the fifth and faces Benjamin Becker next.
"I knew he was struggling physically - you never want to see somebody have real medical issues out there," said Agassi.
This just means the world to me
"It gets more difficult to concentrate on what you're doing, because from one standpoint all you really need to do is keep the ball in play.
"But I felt so good today and what a time to feel it.
"This just means the world to me. All you guys refreshed my faith in the human spirit and I can't thank you enough for that."
Baghdatis played down his physical problems and paid tribute to the American.
"It wasn't physical - I think it was about stress. Andre has more experience than me, so maybe that's why," he said.
"I want to wish Andre good luck, not only for this match but for his life.
"He's more than a legend. He gave so much to the tour."
With every match potentially his last, Las Vegan Agassi is being heralded at every turn in New York.
It was no different on Thursday night as the crowd of 23,000 gave him a lengthy standing ovation as he walked onto court.
Baghdatis has reached the Australian Open final and Wimbledon semis this year and went into the match as favourite, but Agassi was the sharper from the start.
A break point went begging in game three but there was no second chance for Baghdatis four games later and Agassi served out the set.
It was exactly the same story in the second as Agassi pulled the strings with his more consistent backhand, forcing errors from Baghdatis.
And when the American earned two break points in game seven of the third it looked like a repeat performance and a quick win for the twice former champion.
Baghdatis fired down an ace on his way to holding, however, and promptly broke Agassi for the first time in the following game before sealing the set.
Agassi left his younger rival standing early in the fourth set, sending the New York fans wild with a magnificent break in game two and another in game four.
But then the unthinkable - Baghdatis fought back to win seven of the next eight games and broke immediately at the start of the fifth.
To the relief of almost everyone, Agassi broke straight back and what followed was one of the most dramatic sets that even the American veteran can have played.
The key moment came when Baghdatis suffered cramp in game nine.
And although he held on for two more games, a wayward backhand on the second match point handed Agassi victory and extended his remarkable story.