NEW YORK (AFP) - World No. 1 Rafael Nadal battled back from a set down to reach the US Open last 16 for a ninth time on Saturday.
Nadal, 31, saw off Argentine lucky loser Leonardo Mayer 6-7 (3-7), 6-3, 6-1, 6-4, taking his record over the world No. 59 from Buenos Aires to 4-0.
He will face Ukraine's Alexandr Dolgopolov, against whom he has a 6-2 win-loss record, for a place in the quarter-finals.
Five-time champion Federer brushed aside 31st seed Feliciano Lopez 6-3, 6-3, 7-5 to take his career record against the Spaniard, playing a 63rd successive Grand Slam, to 13-0.
Next up for Federer is Philipp Kohlschreiber, whom he leads 11-0.
Nadal had also dropped the first set of his second-round match against Japan's Taro Daniel before winning in four.
Saturday was almost a carbon copy with the 15-time Grand Slam winner unable to convert any of six points in the opener.
But the match turned in the 10-minute seventh game of the second set when, on his 14th break point of the encounter, he finally smashed his way through.
There was no way back for Mayer, who ended the match with 52 unforced errors and his record against top-10 opponents at 1-25.
"It was a long day," said Nadal who brought the curtain down on the day session at 8.40pm and under the Arthur Ashe Stadium roof. "It was tough. I had 14 break points - that's not a good figure. But I was there mentally and fought a lot at the right moments."
Germany's Kohlschreiber eliminated Australia's John Millman 7-5, 6-2, 6-4.
Austrian sixth seed Dominic Thiem defeated France's Adrian Mannarino 7-5, 6-3, 6-4 to make the last 16 for the third time in four years.
Thiem next faces 2009 champion Juan Martin del Potro of Argentina, who put out Spain's Roberto Bautista Agut 6-3, 6-3, 6-4.
Russia's Andrey Rublev became the second teenager in the last 16 when he beat Bosnia's Damir Dzumhur 6-4, 6-4, 5-7, 6-4.
Rublev, just 19, faces Belgian ninth seed David Goffin who progressed when 2016 semi-finalist Gael Monfils retired with a right knee injury.
Women's top seed Karolina Pliskova saved a match point to defeat China's Zhang Shuai, hanging on to her world No. 1 spot in the process.
Top seed Pliskova, the runner-up last year, triumphed 3-6, 7-5, 6-4 but was forced to save a match point in the 10th game of the second set and recover from a break down in the decider.
"I was match point down and I thought I haven't tried many forehand winners down the line. That's what I did. I may not have got another chance," said the 25-year-old, who will face American Jennifer Brady for a place in the quarter-finals.
Had she lost on Saturday, Pliskova would also have been guaranteed to lose her world No. 1 ranking to either Wimbledon champion Garbine Muguruza or Elina Svitolina.
Ukraine fourth seed Svitolina stayed in contention for the top ranking with a 6-4, 7-5 win over Shelby Rogers of the United States.
Russia's Darya Kasatkina reached the last 16 of a Grand Slam for the first time by seeing off French Open champion Jelena Ostapenko, the 12th seed, 6-3, 6-2.
Meanwhile, controversial Italian Fabio Fognini was kicked out of the US Open for making foul-mouthed comments to female umpire Louise Engzell during his first-round loss to Stefano Travaglia.
Fognini and compatriot Simone Bolelli had reached the third round of the men's doubles but tournament organisers have now axed him from the event.
Fognini, the world No. 26, was also fined US$24,000 (S$32,500).
However, Nadal insisted that that tennis chiefs were wrong to wait three days before kicking the controversial Italian out.
Tennis chiefs had explained the delay in making a decision on a possible suspension on having to wait for a translation of the player's brief remarks.
"It takes four days for that translation? I don't think so. Easy to find," said Nadal.
"Of course it is not a positive thing. Of course if you are not doing the right things on the court, of course you need to be in some way affected, no?" added the Spaniard.
"But at the same time is true that things can be made to happen earlier because I believe that he played two doubles matches. If they want to suspend him, will be much better to do it immediately, not three days later or four days later, because then he was here playing for a few days.
"Now he is out already winning two matches. I think it is not the ideal situation. Probably something that will go immediately to check it, and if he deserve a suspension, he takes it, and if he don't deserve, don't take it."
A tournament statement said that Fognini had been provisionally suspended. As a result, his and Bolelli's third-round doubles opponents, Nicholas Monroe and John-Patrick Smith, were given a walkover into the quarter-finals.
"Pursuant to the Grand Slam Code of Conduct, Fabio Fognini is hereby provisionally suspended from further participation in the US Open pending a final determination whether a major offence has been committed during his first-round singles match," said the statement. "The provisional suspension is with immediate effect and, therefore, Mr Fognini has been withdrawn from his upcoming doubles match."
Fognini has a controversial history over his on-court behaviour and was handed a record fine of US$27,500 at Wimbledon in 2014.
"I apologise to the fans, to the referee for what happened," he wrote in Italian on Twitter. "It was just a very bad day, but it did not forgive my behaviour in the match. Although I'm a hot-head (and though I've been right in most circumstances) I was wrong. But in the end it's only a tennis match."
India's Rohan Bopanna, who had lost in the second round of the doubles to the Italian pair alongside partner Pablo Cuevas, accused the organisers of dithering.
"I wanted them to play the whole tournament. If US Open is letting them play 2rounds. Let them play whole thing and then make a decision," Bopanna tweeted.
"If a player is under investigation, As a tournament you do not schedule his match till a decision has been taken."
He added: "It's a career of all the individuals who r involved. Which US open clearly do not care about."