Meanwhile, Maria Sharapova crashed out of the Open, losing to fellow former world number one Caroline Wozniacki, leaving only three of the top 10 seeds in the women's draw standing after Bencic had taken care of ninth-ranked Jelena Jankovic.
On a day of shocks at the US Open, China's Peng Shuai reached her first singles quarter-final at a major by beating experienced Czech Lucie Safarova while, in the men's draw, fourth-seed David Ferrer was defeated by Gilles Simon of France.
Even the great Federer, a five-time champion, had an early struggle, dropping the first set in his third round tie against Spain's Marcel Granollers before booking his fourth round spot.
Bencic, 17 and ranked 58th, dismissed former world number one Jankovic 7-6 (8/6), 6-3 to become the youngest US Open quarterfinalist since Martina Hingis won the title in 1997 at the age of 16.
Hingis, whose mother Melanie Molitor is one of Bencic's coaches, was courtside for the match, lending a little moral support to her young compatriot, who won the 2013 junior title at Wimbledon and Roland Garros but hadn't made it past the third round in three major main draw appearances this year.
"I just tried to play the match point like it was a normal point, but I was so tight," the beaming youngster said.
Bencic will now face China's Peng who clinched a 6-3, 6-4 win over 14th-seeded Safarova with a ninth ace on match point having already defeated fourth-seeded Pole, Agnieszka Radwanska in the second round.
Federer battles back
Second-seeded Federer, the champion between 2004-2008, came back from a set down to defeat Granollers 4-6, 6-1, 6-1, 6-1 by racing away with 20 of the last 24 games of the match which had been interrupted due to rain and the threat of lightning.
The Basel native, bidding to become the oldest Grand Slam champion in more than 40 years, clinched his 70th win at the tournament on the back of 57 winners and13 aces.
But the 33-year-old had struggled in the first set where he slipped to 2-5 down against the world number 42 before he grasped welcome respite in the locker room to sit out the storm.
"It was a good match and I managed to turn it around as Marcel was on fire at the start," said Federer.
Federer will face Roberto Bautista Agut for a place in the quarterfinals after the 26-year-old Spaniard beat France's Adrian Mannarino 7-5, 6-2, 6-3.
Gilles Simon sent Spanish fourth seed Ferrer crashing to his earliest US Open defeat in five years with a 6-3, 3-6, 6-1, 6-3 third round win.
The 26th seeded Simon capitalised on the 52 unforced errors of the 32-year-old Ferrer, a semi-finalist in 2007 and 2012, who appeared to struggle physically towards the end.
Simon goes on to face Marin Cilic of Croatia, who beat South Africa's Kevin Anderson 6-3, 3-6, 6-3, 6-4, for a place in the quarter-finals.
Czech sixth seed Tomas Berdych, a semi-finalist in 2012, beat Georgian-born Russian Teymuraz Gabashvili 6-3, 6-2, 6-4 and next plays Dominic Thiem of Austria, the youngest player in the top 50 at just 20.
Thiem, who turns 21 on Wednesday, reached his first Grand Slam last-16 with an impressive 6-4, 6-2, 6-3 win over left-handed serve-and-volleyer Feliciano Lopez of Spain who is 12 years his senior.
Gael Monfils celebrated his 28th birthday a day early by sweeping past French Davis Cup teammate Richard Gasquet, the 12th seed, 6-4, 6-2, 6-2.
He will face Bulgarian seventh seed Grigor Dimitrov who saw off Belgium's David Goffin, 0-6, 6-3, 6-4, 6-1.