Top-ranked, five-time champion Federer was set to play 23rd-seeded Mardy Fish in a fourth-round match when the American withdrew, citing health concerns.
"I regret that I have to withdraw from the U.S. Open for precautionary measures," Fish said in a statement. "I was reluctant to do so, but am following medical advisement. I had a good summer and look forward to resuming my tournament schedule in the fall."
That put Federer into a men's-record 34th straight Grand Slam quarterfinal.
His next opponent is the Czech Republic's Tomas Berdych, who reached his first U.S. Open quarterfinal in 10 tries by dispatching 11th-seeded Spaniard Nicolas Almagro 7-6 (7-4), 6-4, 6-1 at Armstrong Stadium.
Berdych owns a 3-3 record in his last six matches against Federer. He upended the Swiss superstar in the 2010 Wimbledon quarterfinals.
Meanwhile, Britain's Murray took advantage of six double-faults by his opponent to prevail over 15th-seeded Milos Raonic of Canada, 6-4, 6-4, 6-2.
The Olympic gold medal winner converted 4-of-12 break points in the victory.
He now goes on to face 12th-seeded Croat Marin Cilic, who reached his second career U.S. Open quarterfinal with a 7-5, 6-4, 6-0 decision over Martin Klizan of Slovakia.
Celebrity Breakups and divorces of 2014 [PHOTOS]