Novak Djokovic avoided suffering the same fate as Roger Federer as he overcame the never-say-die John Millman to reach the semi-finals.

Two nights after Millman’s tenacity and quality ball-striking caused Federer to wilt in the New York humidity, Djokovic battled to a 6-3, 6-4, 6-4 victory.

Although the scoreline looks straightforward, the match lasted two hours and 49 minutes, with the first set taking an hour and the second 59 minutes.

Djokovic, who next faces Kei Nishikori in a rematch of the 2014 semi-final, which he lost, said: “I was very tested. Almost three hours, it’s midnight now. Credit to John for putting up a great battle, he’s truly a great fighter. He’s had an amazing tournament.

“First quarter-finals, he won against Roger. To come out after that kind of win and fight for three hours, he deserves a round of applause definitely.

“I was struggling, he was struggling, we were all sweating, changing clothes. Just trying to hang in there, find a way to win a match. It happened a couple of times that you survive on the court then thrive with a win.”

Conditions were not as hot or humid as they had been on Monday or Tuesday, but still uncomfortable and Djokovic again looked in distress and asked the doctor for a nasal spray.

That came during an unusual stoppage after four games of the second set when Millman requested to go off court to change his whole kit – organisers clarified later that the break was permitted because the Australian was sweating so much it was making the court dangerous.

Djokovic, grateful for a bit of a breather, sat grinning in his chair with his shirt off, much to the crowd’s amusement.

On the six-minute break, Djokovic added: “He [Millman] was apologising, actually. He was saying that he felt very sorry that he had to leave the court but he was sweating so much.

“I said, ‘Man, go ahead! I’m actually okay sitting down for 10 minutes, just relaxing.’ I needed that rest so that was great.”

The duo also had a brief chat following the match, with Djokovic saying: “[We were just showing] Respect for each other. I’ve played him only once in my career, a month ago in London on grass [at Queen’s].

“I’ve known him, he’s been around a few years. He’s been known around the tour as a guy with a hard work ethic and you can see that.

“He fights for every point and he’s never going to hand you the win. He played an amazing tournament.”