On a dramatic day which saw a record created for the longest women's match, and a new Grand Slam high for retirements from the men's tournament, Andy Murray escaped his earliest exit in 10 years when he came back from two sets down to make the last 32.
There was also a late security scare when a drone crashed into the corner of Louis Armstrong Stadium.
Then, after midnight, 2009 and 2014 runner-up Caroline Wozniacki, the fourth seed, was knocked out by Czech world number 149 Petra Cetkovska who saved four match points to win 6-4, 5-7, 7-6 (7/1).
Cetkovska, who recently missed seven months of action with a hip injury, committed 60 unforced errors but unleashed 60 winners.
World number two Federer, the 17-time Grand Slam champion, needed just 80 minutes to rout Belgium's Steve Darcis 6-1, 6-2, 6-1.
The 34-year-old Swiss star, who was champion from 2004-2008 and runner-up in 2009, goes on to face German 29th seed Philipp Kohlschreiber.
Federer has lost just nine games in the first two rounds, his fewest in 16 appearances.
"Very often I started this tournament quite strong. It's always gone quite well for me," said Federer.
"I've always enjoyed conditions here, the balls, the speed of the court, the atmosphere in the arena. It's always worked very well for me."
Darcis later tweeted that playing Federer was like facing "a Martian."
Third seed and 2012 champion Murray came back from two sets down to defeat tiring Frenchman Adrian Mannarino 5-7, 4-6, 6-1, 6-3, 6-1 on Arthur Ashe Stadium.
Murray goes on to face Brazilian 30th seed Thomaz Bellucci for a place in the last 16.
Murray, 28, who had needed four sets to beat Nick Kyrgios in the opening round, fired 21 aces while Mannarino was undone by 61 unforced errors.
Former world number one Hewitt, the champion in 2001, made a dramatic farewell battling from two sets down and having two match points before losing to fellow Australian Bernard Tomic on a rocking Grandstand court.
In his final match in New York, the 34-year-old fell 6-3, 6-2, 3-6, 5-7, 7-5 after three hours and 27 minutes after his 57th career five-set match.
Hewitt will retire after January's Australian Open.
"I would have liked to have been able to enjoy it a bit more," said Hewitt who was described as a "legend" by Tomic.
"But obviously when it's so tight, especially in the fifth set, you're just trying to find a way to obviously get across the line."
America's Jack Sock and Denis Istomin retired from their matches as they wilted in the 33-degree Celsius (91.4 F) heat.
Twelve men -- a record at the majors -- as well as two women have now quit matches in the first four days.
The 22-year-old Sock was leading Belgium's Ruben Bemelmans 6-4, 6-4, 3-6, 1-2 when he started cramping and was forced to retire.
Sock, the 28th seed, collapsed on the court, where he was treated with ice packs by US Open medical staff before being helped off to the shade of the Grandstand.
Bemelmans next plays fifth-seeded French Open champion Stan Wawrinka who beat South Korean teenager Chung Hyeon 7-6 (7/2), 7-6 (7/4), 7-6 (8/6).
Istomin called it quits on Court Seven against Austrian 20th seed Dominic Thiem, who was 6-4, 6-4, 1-0 up at the time, with his win coming on his 22nd birthday.
The carnage led again to suggestions that the men, who play the best of five sets, should be accorded the same heat protection as women players.
The WTA allows a 10-minute break between the second and third sets of women's matches when the mercury bursts through 30.1 degrees.
"When it's extremely hot and humid, it helps to have that break," said Murray.
"You get the chance to sort of go off and change, get under a cold shower if you want to."
New York police were investigating a drone which crashed on Armstrong, causing Flavia Pennetta's victory over Monica Niculescu to be held-up.
"I feared the drone was a bomb," Pennetta, who next faces Cetkovska, told www.tennisworlditalia.com.
Britain's world number 97 Johanna Konta made history when she defeated Wimbledon runner-up Garbine Muguruza in the longest women's match in US Open history.
Konta won 7-6 (7/4), 6-7 (4/7), 6-2 in 3 hours 23 minutes, beating by seven minutes the previous longest match played in 2011 when Samantha Stosur defeated Nadia Petrova.
The defeats for Muguruza and Wozniacki left just three of the top 10 left in the tournament -- top seed Serena Williams, second seed Simona Halep and fifth-seeded Petra Kvitova.