Juan Martin del Potro has revealed he nearly retired before producing a remarkable comeback in the US Open fourth round.

Del Potro went up against sixth seed Dominic Thiem for a place in the quarter-finals and the Austrian was comfortably on course for a place in the last eight, having taken the first two sets 6-1 6-2.

The Argentine, who hit his first winner of the match in the 12th game, was visibly struggling and a medical timeout was required in a bid to prolong the contest at Flushing Meadows.

It took until the third set for the 28-year-old to show some fight and he steamrolled his opponent, winning the set 6-1, before taking the fourth in a tie-break, levelling the match at 2-2.

The decider was a tense affair but it was Del Potro, a winner of the event back in 2009, who produced the goods when needed and he wrapped up a remarkable comeback, with a 6-4 final set win.

Argentina's number one has spoken of his delight at getting past Thiem while also revealing he was very close to calling it quits after going two sets down in New York.

"I played one of the epic matches of my career here at the US Open, which is my favourite tournament, in front of a great crowd," he said. "I was thinking to retire in the middle of second set because I couldn't breathe, I couldn't move well, and Dominic was dominating the match so easy."