Roger Federer is out of Novak Djokovic’s way.

After straight-setting Portugal’s unseeded Joao Sousa 6-3, 6-4, 6-3 in the fourth round amid the scorching heat on Labor Day, Djokovic sat back as the No. 2 seed Federer was stunned by heavy underdog John Millman 3-6, 7-5, 7-6 (7), 7-6 (3) in the fourth round. Federer’s loss spoiled a potential Wednesday showdown with Djokovic, which could have been the match of the tournament.

Now, Djokovic will be a heavy favorite against Millman, and if he is victorious the winner of Kei Nishikori-Maran Cilic in the semifinals. Rafael Nadal could potentially be waiting for him in the finals.

“Next to [Rafael] Nadal, my biggest rival I’ve had throughout my professional career,” Djokovic said of Federer. “The matches I’ve played against him have shaped me into the player that I am today. Those were the guys I had to beat in order to be the No. 1, to win slams.”

Djokovic, the sixth seed on a comeback trail, is a major reason Federer is without an Open title for 10 years. In 2010 and 2011, the Serbian faced match points against Federer and rallied to win.

Djokovic became part of the so-called Big 4 with those upsets. And now he has returned after missing last year’s Open with elbow problems then undergoing elbow surgery after January’s Australian Open.

He’s back in a big way. He ripped Federer in the finals of the Cincinnati Open tune-up two weeks ago and is playing deadly in Flushing Meadows, where he won US Open titles in 2011 and 2015.

“At the beginning of the career, I probably wasn’t seeing things that I’m seeing them now in terms of being in an era with these guys,’’ Djokovic said. “Now I’m grateful that I am in the era with these guys, that I get a chance to witness their greatness as well, their rivalry, Nadal and Federer, which is the biggest rivalry of all time.”

Ahead 2-1 in the third set Monday, Djokovic took an injury timeout and left the court to cool down. His best move of the Open was a second-round naked ice bath he took after the third set against Hungary’s Marton Fucsovics when a special heat-break policy was in place because of 97-degree weather.

“I’m not 21 anymore,” Djokovic said. “I still don’t feel old, but at the same time here is a little biological clock that isn’t working in your favor [as it was] when you’re 20.”

Belgian’s David Goffin’s quit job in the semifinals in Cincinnati against Federer in the second game of the second set, claiming a shoulder injury, didn’t have its desired effect.

The 10th seed’s shoulder wasn’t good enough to beat 2014 Open champion Marin Cilic in their fourth-rounder. Cilic won in straight sets 7-6, 6-2, 6-4. Cilic’s last match, a five-setter over Alex de Minaur, ended after 2:20 a.m. Sunday.

In a battle of unseeded women in the fourth round, Ukraine’s Lesia Tsurenko rallied to beat the Czech Republic’s Marketa Vondrousova 6-7, 7-5, 6-2 to reach her first grand slam quarterfinal. The 36th-ranked Tsurenko, who upset Caroline Wozniacki, left the court after the first set because of the heat and was a different player when she returned. She faces Japan’s Naomi Osaka, who has lived in Florida most of her life.

Vondrousova was not pleased by Tsurenko’s break and voiced her frustration after the match.

“I don’t think she was struggling,” Vondrousova said. “I think she was acting.”