Swiss fifth seed Stan Wawrinka, the reigning French Open champion, reached the quarters for the third time with a 6-4, 1-6, 6-3, 6-4 victory over American Donald Young.
Wawrinka dropped his first set of the tournament but made an eighth quarterfinal in his past nine Grand Slams, denying 68th-ranked Young his first trip to a Slam quarterfinal.
“The set was so quick. I wasn't there mentally,” Wawrinka said of his second-set letdown.
“Calmed down a little bit. I began to be more aggressive, started moving my feet better.”
Young was the first player since Gilles Muller in 2008 to rally twice from two sets down in a US Open, having been 0-17 in such sets before this week, but the lefthander fell to 3-18 against top-10 opponents.
“He had the crowd. It was a tough match for sure,” Wawrinka said. “It was a great atmosphere.”
Wawrinka improved to 2-1 in the rivalry with Young, who upset the Swiss in a fifth-set tie-breaker at the 2011 US Open and Wawrinka beating him six weeks later at Shanghai.
Wawrinka, 30, smacked a backhand service return winner to break Young for a 2-1 edge and denied the American's only break chance of the first set with a forehand winner in the fourth game.
Young, 26, had lost the first set in every prior match, too, and he bounced back again as Wawrinka netted forehands to surrender breaks in the fourth and sixth games, smashing his racquet to the cement at one stage in frustration.
“Sometimes you don't control yourself. You need to put the pressure out,” Wawrinka said. “I played really well after.”
Wawrinka raced ahead 5-0 in the third set. Young battled back to 5-3, but Wawrinka then held on a stunning running backhand winner to finally take the set.
He broke Young to open the fourth set and held serve to the end, which came after two hours and nine minutes.
Wawrinka will next play South African 15th seed Kevin Anderson, who stunned the crowd by putting out Brit Andy Murray in four sets.
Swiss second seed Federer, seeking his sixth US Open title, dispatched US 13th seed John Isner 7-6 (7/0), 7-6 (8/6), 7-5 to reach a quarterfinal against French 12th seed Richard Gasquet, who ousted Czech sixth seed Tomas Berdych 2-6, 6-3, 6-4, 6-1.
“Of course Roger will be the favourite of the match but I will have nothing to lose,” said Gasquet, who is 2-14 lifetime against the Swiss star.
Federer, trying to become at 34 the oldest US Open champion since Ken Rosewall in 1970, stretched his US Open win streak over Americans to 12 since losing to Andre Agassi in 2001.
Isner had held in 110 consecutive US Open service games since broken by Germany's Philipp Kohlschreiber in the third round in 2013, but Federer ended that streak on match point to close out the victory in two hours and 39 minutes.
“John has one of the best serves in the game,” Federer said. “You have just got to hang around and win your service games.”
Federer also inflicted the first shutout tie-break loss upon Isner.
“I served very well, picked up his second serves,” Federer said. “You've got to get a little lucky.”