Gasquet will next play Germany's Alexander Zverev, last year's finalist who has won three titles this season, after he muscled past baseliner Roberto Bautista-Agut 6-7 (6) 7-6 (1) 6-1.
Fourth-seeded Marin Cilic avoided becoming the latest high-profile player to depart early by beating Stefan Kozlov 6-0, 6-4 and is to play another American, Donald Young, in the last eight. They both served well in set number 2, with no deuces or break points until 4-4, when Roger broke at 15 to take a 5-4 lead, serving for the match in the following game.
Federer, the 18-time Grand Slam title victor who is building up for an assault on an eighth Wimbledon title next month, next faces 2016 Halle champion Florian Mayer for a place in the semi-finals. Federer has yet to drop a set this tournament and is coming off a match in which he produced 11 aces. Second round: Federer bt Mischa Zverev 7-6 (4), 6-4. It was important to stay calm after missing chances to win the set at 5-4, and it's important to win breakers. It's going to be a very tough match.
Federer gained the advantage over Zverev in the tiebreak with a pair of backhand passing shots, ultimately leading him to a first-set victory.
Federer lost to Zverev in last year's Halle semi-finals but beat the German last year in Rome. The Basilea idol obtained a 66 percent of effectiveness with his first serve, gaining 71 percent of almost all his points. The 19-year-old Rublev, who received a wild card for the grass-court tournament, will face another Russian in Karen Khachanov in the next round.