It was the first time Federer has ever lost to a player outside the top 50 in NY and it was even worse considering he was a set and a break up.
The sixth-seeded Serbian leads Sousa 4-0 in head-to-heads, most recently walloping him in straight sets in the second round of last year's French Open.
Millman spends a good amount of training - when he's not with Federer in Switzerland - in Brisbane, Australia, which has similar conditions to the 83 degree, 74 percent humidity of Monday in NY.
Roger Federer of Switzerland reacts during a changeover in a fourth round match against John Millman of Australia on day eight of the 2018 U.S. Open tennis tournament at USTA Billie Jean King National Tennis Center.
"It's hard to discount the guy, because he's obviously the greatest of all time, and he's unbelievable, but that one stands out to me", Mark Knowles, a former No. 1 doubles player turned television analyst, said of Federer's loss to Millman.More news: Is Trump's rewrite of NAFTA hurting a partnership?
"What do I need to improve in my game, my mental approach, mental strength, just ability to cope with the pressure in those moments and try to prevail".
He will now play Novak Djokovic in the quarterfinals on Thursday morning (AEST).
The on-court rivalry between the top-ranked pair and each man's ability to beat the other on any given day sold waves of tickets to the quarter-finals in NY, as people preemptively assumed the two would meet again.
Djokovic was on in the mid-day heat against Joao Sousa and he took care of business.
But he lost that set and then failed to convert a set point in a third-set tiebreak after making errors that surely had fans around the world staring wide-eyed at the television.
The 29-year-old then saved a break point at the start of the third set, which proved a tense affair as both men started to look more comfortable on serve. But a searing ace allowed Federer to survive as he ran away with the first set 6-3. Start with this: Federer held two set points while serving for the second at 5-4, 40-15 and did not pull through.More news: India, US discuss trade, defence, visas, oil in first '2+2' dialogue
John Millman? Yes, that John Millman, an Aussie journeyman who had never made a quarterfinal of a Grand Slam.
Through his opening round matches the Serb and his performances suffered under a blazing sun and, with temperatures once again nudging into the 90s Fahrenheit (32 Celsius), the extreme conditions again took a toll on 31-year-old.
Distracted, he was broken at love in the next game and Djokovic served out the match without fuss.
You don't have to know much about tennis to know that Roger Federer is really, really good at it.
Before the match, Federer had a word of encouragement for Millman, who has practised with him in Switzefland. I was guarding him while he slept, " Ron Millman said.
"The matches I've played against him have shaped me into the player that I am today".More news: Philippines mayor shot dead inside his office
Before their fourth round clash, Millman said the Swiss star was "always someone he looked up to".