Roger Federer was knocked out of the U.S. Open on Monday by unheralded John Millman of Australia, who stunned him to set up a quarter-final against Novak Djokovic.

The 37-year-old Swiss had prioritized winning a sixth title at Flushing Meadows this year, but was far off the pace against the world No. 55.

Millman fought back to win 3-6, 7-5, 7-6 (7), 7-6 (3) in three hours, 38 minutes.

Story continues below advertisement

Now he meets Djokovic in his first Grand Slam quarter-final on Wednesday.

Djokovic beat Joao Sousa of Portugal 6-3, 6-4, 6-3 in blazing heat earlier Monday to move into the final eight at Flushing Meadows for the 11th time.

Other winners, also advancing to the quarter-finals, were Kei Nishikori of Japan, Marin Cilic of Croatia and, on the women’s side, Madison Keys. Naomi Osaka and Carla Suarez Navarro, who ousted Maria Sharapova in an evening match.

Images are unavailable offline.

Novak Djokovic of Serbia advanced easily to the quarter-finals on Monday.

Matthew Stockman/Getty Images

Djokovic, the No. 6 seed, is the reigning Wimbledon champion.

Djokovic left the court at Arthur Ashe Stadium for a medical timeout — the second time in the tournament he’s sought help from a doctor because of harsh weather.

“I’m not 21 anymore. That was 10 years ago. I still don’t feel old. But at the same time, there is a little biological clock that is not really working in your favour,” the No. 6-seeded Djokovic told the crowd afterward. “Sometimes, you just have to survive.”

Nishikori easily outclassed Philipp Kohlschreiber 6-3, 6-2, 7-5 earlier on Monday.

Story continues below advertisement

The Japanese 21st seed, a finalist at Flushing Meadows in 2014 and a semi-finalist in 2016, fired 29 winners to end the run of Kohlschreiber, who had beaten fourth seed Alexander Zverev in the previous round.

Nishikori appeared to be racing towards an easy win before Kohlschreiber unexpectedly broke the 28-year-old to level the third set at 5-5.

But that only delayed the inevitable as Nishikori kept his focus to seal the win and extend his perfect record against the German to 3-0.

“[I was] really lucky to finish in three sets, It was really hot on the court,” a sweat-soaked Nishikori said in an on-court interview. “I think we both struggled a little bit with the heat.”

Nishikori later told reporters that the brutal conditions made it difficult to keep his head in the match.

“It’s not easy with the heat. You know, I couldn’t think too much between the points. It’s not easy to focus [on] every point, you know. You lose some concentration,” he said.

Story continues below advertisement

Kohlschreiber thought the heat – as well as Nishikori’s slick performance – made the match particularly challenging.

“He pushed, especially in my weaknesses, pretty good, you know, returning my second serve very aggressively, very deep,” Kohlschreiber told reporters. “He didn’t make many mistakes. He pushed me around. He was too much in control of the game.”

Nishikori will next face seventh seed Cilic in a rematch of the 2014 final.

Cilic showed no ill effects from his gruelling, late-night victory two nights ago as the Croatian beat David Goffin 7-6 (6), 6-2, 6-4.

“I started a little bit slower and he was playing good in the beginning and when he was serving in the first set at 5-4 it was a crucial break for me to get back in the game,” said Cilic, who made just 46 per cent of his first serves.

“After the first set, it felt like he slowed down his first serve and at the end he told he’s got some problems with his shoulder so it was a little bit unfortunate for him and he was not playing the best the last two sets, but I kept my rhythm and played well.”

Story continues below advertisement

The win puts Cilic into the quarter-finals of the year’s final Grand Slam for the fifth time.

Images are unavailable offline.

Madison Keys relied on both her dangerous serve and powerful groundstrokes to advance to the quarter-finals.

Matthew Stockman/Getty Images

On the women’s side, Keys eased into the quarter-finals with a 6-1, 6-3 victory over Slovakia’s Dominika Cibulkova.

The 14th-seeded American, looking to go one better than her runner-up finish at Flushing Meadows last year, relied on both her dangerous serve and powerful groundstrokes to deny Cibulkova any chance of an upset win.

“The biggest thing is just being able to push her back off of the baseline where she likes to hold her ground and just be able to dictate points like that,” Keys told reporters. Keys has been a quiet presence for much of this tournament as public attention was focused on other stars.

“It’s, you know, kind of nice to be under the radar,” Keys said. “Either way, I’m pretty used to it either way. This one just seems like it’s a little bit more low key.

“There is a bunch of big stories, obviously. Serena (Williams) is back. Sloane (Stephens) is playing really well. There is just a lot going on this year.”

Story continues below advertisement

Keys took care of her business in 77 minutes Monday. She finished with a 6-0 edge in aces, and she broke Cibulkova’s serve five times while facing just one break point.

“I feel like today I played really well,” Keys said. “I think I served well, other than one game. And other than that, I think I did a really good job to stay in some important games where I was down love-30 or 15-40. That’s what I’m most happy about and what I have been looking at.”

Next up for Keys is a quarterfinal matchup with 30th-seeded Suarez Navarro of Spain, who ousted 22nd-ranked Sharapova of Russia 6-4, 6-3.

While both players hit 15 winners, Sharapova was done in by committing 38 unforced errors. Suarez Navarro, whose 30th birthday was Monday, gave away just 20 points.

“Thank you so much guys,” Suarez Navarro said courtside after being wished happy birthday by the crowd. “It’s the first time I’ve played this year at night. I’m very happy because I played a good match.”

The Spaniard said she expects a battle from Keys in the quarter-finals.

Story continues below advertisement

“It will be a really tough match. She is from the United States so the crowd will probably help her,” Suarez Navarro added.

“I need to be aggressive ... try to be solid, run and fight. This is the way that I can play really good tennis. I have the character inside, sometimes I have to show more but, well, I’m working on that.”

Sharapova said she was too tentative.

“I didn’t take care of the chances that I had,” the Russian told reporters. “By chances, I mean the balls that were a little bit shorter.

“I hesitated to move forward. The balls where I did attack, I made unforced errors, especially on that inside-out forehand today.”

Earlier, Osaka became the first Japanese woman to reach the quarter-finals of a Grand Slam in 14 years, edging Aryna Sabalenka 6-3, 2-6, 6-4 in a matchup of 20-year-olds.

The No. 20 seed had to work much harder than she had so far in the tournament, where she had won 22 consecutive games leading into the match Monday.

She finally pulled it out when the No. 26-seeded Sabalenka double-faulted on match point, tossing her racket to the court in frustration.

The last Japanese woman to reach the final eight in a Grand Slam had been Shinobu Asagoe at the 2004 U.S. Open.

An emotional Osaka wiped tears from her eyes in an on-court interview, thanking the crowd and saying she would not have forgiven herself had she lost.

“I was just thinking I have to fight for every point; even if I break a leg I should try to get to every ball,” she said.

Osaka said Sabalenka’s blistering serve had been a key challenge to overcome toward the end of the match.

“I felt like I had a lot of chances to break her in the third set, then she would serve these really amazing serves. Like a part of me knew it was coming, but at the same time I was always very unprepared,” Osaka said. “I’m just real glad I was able to win in the end.”

She next faces Lesia Tsurenko of Ukraine.