And second-seeded Rafael Nadal ended the run of Paris debutant Juan Ignacio Londero with a typically dominant 6-2 6-3 6-3 victory.
Federer, the 20-time Grand Slam champion, back at Roland Garros after a three-year hiatus, cruised through the opening rounds seemingly unchallenged and his last-16 encounter was no exception.
But things are likely to get trickier for Federer as the third seed will next face his old friend and 2015 champion Stan Wawrinka after the 34-year-old won an extraordinary contest against sixth seed Stefanos Tsitsipas.
The pair battled for five hours and nine minutes on Court Suzanne Lenglen before Wawrinka eventually triumphed 7-6(6) 5-7 6-4 3-6 8-6.
— Roland-Garros (@rolandgarros) June 2, 2019
After just over an hour in his match, Federer was already two sets up but Mayer offered some semblance of resistance in the third until the sixth game, when Federer, 37, broke decisively, ending his opponent’s ordeal on the first match point.
“I served super well and Leonardo had trouble returning. I was able to put pressure on him and I’m very happy with my performance,” Federer said.
Nadal also produced claycourt tennis of the highest quality to make the last eight of a Grand Slam event for the 38th time.
The Spaniard won his 90th match at the French Open as the 11-time champion cruised to victory against the 78th-ranked tournament debutant Londero in two hours and 13 minutes.
Nadal has only lost two matches at the tournament, in 2009 and 2015 and 13th quarterfinal appearance will move him one ahead of world No.1 Novak Djokovic, who can, however, draw level on Monday against German Jan-Lennard Struff.
Nadal must wait until Monday to see who he now meets out of Japanese seventh seed Kei Nishikori or unseeded Frenchman Benoit Paire after their match was suspended due to darkness, with Nishikori leading two sets to one.
23 August 2016
You can recognise your favourite tennis players when they're on the court, but what about ... More
7 November 2016
Double Wimbledon champion, double Olympic champion and now world No.1. But what doesn't An... More
13 November 2017
Jack Sock had just played half volley against Roger Federer at the ATP Finals that lofted... More