Having been pushed to the brink by John Millman in a late-night classic on Friday, Federer again dropped the opening set to Hungary’s Marton Fucsovics.
But this time he did not need a deciding set, scrapping hard in cool, breezy conditions to win 4-6 6-1 6-2 6-2 after two hours and 11 minutes.
Federer admitted the Millman match had affected him, saying: “It was a tough start, I thought Marton played clean. After Millman, the guy gave me a beatdown from the baseline, so maybe took away my confidence a bit.
“I just had to figure it out. I had a good start to the second set and from there it got a little bit easier.”
Federer did not look physically at his best, which was no surprise after his efforts two nights before.
He said: “I was able to recover and play a good match so I’m sure I’m going to feel better every day that goes by.”
Defending champion Novak Djokovic reached his 46th slam quarter-final in confident fashion with a 6-3 6-4 6-4 victory over 14th seed Diego Schwartzman.
After dropping a set to Jan-Lennard Struff in the opening round, Djokovic has begun to look ever more like the player who has won six of the last nine titles here.
The second seed said: “I had a fantastic couple of matches in a row. I felt more confident going through the ball, hitting serves really well.
“Today was a good test because Diego was in form. I stepped out on the court with a clear game plan. I think I kept things pretty much in control in all three sets.”
Next Djokovic will face resurgent 32nd seed Milos Raonic, who is yet to drop a set and is through to the quarter-finals for the fifth time in six years.
Amid all the hype around young Canadians Bianca Andreescu, Denis Shapovalov and Felix Auger-Aliassime, Raonic has felt a little like yesterday’s man, but the 29-year-old insists he is not trying to prove a point.
“Couldn’t care less,” he said. “I just care about how I’m playing and feel on the court.”
Raonic is certainly playing very well, following up his upset of Stefanos Tsitsipas by beating Marin Cilic 6-4 6-3 7-5.
He has won only two sets in nine matches against Djokovic, but a number of the sets have been close.
“I’m going to have to serve well, clearly, and then I think I’m going to have to get my return at a high percentage, make him play a lot of those points, and then try to be efficient on my service games,” said Raonic.
Federer’s next opponent is American Tennys Sandgren, who is once again playing well above his ranking at a slam.
Ranked 100, Sandgren is through to the quarter-finals here for the second time in three years after winning a wild contest against 12th seed Fabio Fognini 7-6 (5) 7-5 6-7 (2) 6-4.
Sandgren’s politics were the focus two years ago but here he was something of a sideshow to the volatile Fognini, who rowed with the umpire and the supervisor, took a long bathroom break and received a point penalty.
Sandgren implied in an on-court discussion that he believed Fognini was allowed to bend the rules, and he explained later: “It seemed odd that we probably were already at time between the first and second set, then there was a bathroom break.
“I would have liked to have seen the ref be a little more forceful for what the times actually were.
“It’s a roller coaster sometimes with him. Sometimes you’re just a passenger with what’s going on.
“He doesn’t play well, all of a sudden he’s playing amazing, you’re stuck with your hands in your pockets like, ‘Shoot, I’d like to play tennis, too’.