Djokovic lost to Roger Federer in the 2007 US Open final
Third seed Novak Djokovic overcame a hip problem and exhaustion to edge Tommy Robredo 4-6 6-2 6-3 5-7 6-3 and reach the US Open quarter-finals.
The Serbian struggled with his forehand in the first set and saw Robredo snatch it after breaking at 4-4 but he came back strongly to win the next two sets.
Robredo took the fourth set after more mistakes by Djokovic but he ran out of steam after a heavy fall in the fifth.
Djokovic will play 2003 champion Andy Roddick in the last eight.
"Whoever it is, they will be physically fitter than me, that's for sure," Djokovic said of his next opponent.
Roddick, the eighth seed, was in magnificent form as he thrashed Chile's Fernando Gonzalez 6-2 6-4 6-1 in Tuesday's night match on Arthur Ashe Stadium.
If we start talking about the things that are bothering me now, we will talk until tomorrow
After a run of injuries and poor form, Roddick has looked back to his best in New York and never more so than in demolishing Gonzalez.
And after making just seven unforced errors and dropping only nine points on serve, the American will be optimistic he can cause an upset in the quarter-finals.
"Novak has made himself one of the elite players," said Roddick. "I just got to try to get the upset."
Djokovic, just as in his previous match against Marin Cilic, was far from at his best and Robredo took full advantage in the early stages.
The 15th seed claimed the first break of the match at 4-4 in the first set with a series of thumping returns and converted the advantage.
Djokovic responded well in the second set, which he took with ease thanks to two breaks despite needing treatment on a hip injury.
He also sped through the third set and a stunning backhand down the line set him up for a break at the start of the fourth.
Robredo was not done yet, however, and responded by levelling at 3-3 before putting renewed pressure on the Djokovic serve.
The Serbian, last year's beaten finalist, failed to take a break point at 5-5 and was quickly punished when some wild groundstrokes allowed his opponent to level the match.
Both players looked tired at the start of the decider but it was Djokovic who took the early initiative, breaking to lead 3-2 after Robredo tumbled while trying to return a forehand.
From there, the world number three did not look back, breaking again to seal a hard-fought victory, but his physical condition is a concern looking ahead to the rest of the tournament.
"I didn't feel well," he said afterwards. "The moment I stepped on the court I felt already less energy in the tank. So I really tried to forget about that, to eliminate those things.
"I had to take a medical timeout a couple of times, go to the bathroom, because just many things involved. You know, I want to do everything to win."
In the same half of the draw, defending champion Roger Federer beat Igor Andreev 6-7 (5-7) 7-6 (7-5) 6-3 3-6 6-3.
Federer will next play Luxembourg's Gilles Muller after the qualifier stunned fifth seed Nikolay Davydenko 6-4 4-6 6-3 7-6 (12-10).