Novak Djokovic struggled with the heat again at the US Open but came through an intense clash with Joao Sousa in straight sets to reach the quarter-finals.

Djokovic took a long bathroom break after the second set, much to Sousa’s annoyance, and then went off court again early in the third set after calling for the doctor.

But the sixth seed did not face too many hairy moments in a 6-3 6-4 6-3 victory that took exactly two hours.

Djokovic said: “I’m very happy to get this one done in straight sets. It was much more difficult than the score indicated. Credit to Joao for fighting, he brought a lot of intensity on the court.

“It was very tough conditions, especially the first hour and a half. We are putting in all the work but sometimes you just have to survive.”

The extreme heat policy was again in action, with temperatures climbing over 30C and significant humidity, meaning a 10-minute break between the third and fourth sets, although this match did not get that far.

After a relatively comfortable first set, Djokovic found himself in trouble at the start of the second as Sousa, the first Portuguese player ever to reach the fourth round of a grand slam, broke for a 2-1 lead.

The 13-time grand slam champion hit straight back and went on to take the set but was clearly not enjoying himself in the heat, although his struggles were not as severe as during his first-round clash with Marton Fucsovics.

Sousa, a fiery presence, took exception to Djokovic’s lengthy bathroom break, and was then left sitting alone on court while his opponent consulted the doctor, but ultimately he could not find the shots to hurt him where it mattered.

Djokovic was vague about exactly why he went off court, saying: “It was a couple of things. But, yeah, heat was the adversity today.”

Novak Djokovic puts an ice towel around his head
Novak Djokovic puts an ice towel around his head (Carolyn Kaster/AP)

Sousa said of his opponent’s long bathroom break: “I’m not happy about that, but that’s a rule. He can have a toilet break. I was asking him (the umpire) why he’s taking so long. There is no limit for a toilet break. So I think it’s a rule that is a little bit messy.”

After dropping sets against Fucsovics and Tennys Sandgren, Djokovic has finished his matches against Richard Gasquet and now Sousa in three sets.

“The first couple of rounds, I was still struggling a little bit with the level,” said the sixth seed, who is through to his 42nd slam quarter-final.

“I wasn’t that consistent. Then last match against Gasquet, and also today, I was pretty good. So I’m really pleased with where my game is at at the moment. Getting into the quarter-finals, ready to perform well.”

Djokovic will face the winner of the Monday night clash between Roger Federer and John Millman, while there will be a rematch of the 2014 final between Marin Cilic and Kei Nishikori.

Nishikori defeated Philipp Kohlschreiber 6-3 6-2 7-5 while Cilic was a 7-6 (8/6) 6-2 6-4 winner against David Goffin.

Cilic won easily four years ago and, recalling the clash, Nishikori said: “I was really nervous. I wasn’t nervous before the match but, as soon as I got into the court, it was different. I didn’t have energy left to play five sets. I remember I wasn’t there for the match. So hopefully I can come back to that stage.”