The Spanish clay court specialist won 6-4 3-6 6-1 against third seed Stanislas Wawrinka of Switzerland.
And with the Scot frustrated and struggling physically, Wawrinka prevailed 6-7 (3-7) 7-6 (7-4) 6-3 6-3.
Wawrinka replaced Jo-Wilfried Tsonga in the field after the Frenchman pulled out with a wrist injury.
And he was out of sorts when losing to Stanislas Wawrinka at Flushing Meadows.
When Wawrinka got an opening, he would invariably crush a backhand winner down the line.
Wawrinka led 6-1, 5-2 before losing the second and third sets, but he didn't fade.
Yet for five hours, Wawrinka looked like he, too, could win a Grand Slam title.
If Federer's inclusion for China was a foregone conclusion, Wawrinka's presence was anything but guaranteed.
CNN: Why Federer's friend is flying the Swiss flag at London 2012
Djokovic himself needed five sets to get past Stanislas Wawrinka in the fourth round.
WSJ: Australian Open: Novak Djokovic Beats Andy Murray for Third Straight Title
Know that it will hurt, hurt, hurt (Wawrinka could barely stand after his loss).
"Playing against Wawrinka, it's impossible have an easy match, " said Nadal after his win.
In the fourth round, he won a five-hour, five-set match against Stanislas Wawrinka after trailing 6-1, 5-2.
WSJ: Australian Open: The New Normal: Andy Murray vs. Novak Djokovic
But there was bad news for Djokovic's conqueror, Dimitrov, who was beaten 3-6 6-4 6-1 by Stanislas Wawrinka.
Federer will next face Swiss compatriot Stanislas Wawrinka after he disposed of American Andy Roddick in straight sets.
Nadal will now face France's Jo-Wilfried Tsonga, who saw off Stanislas Wawrinka 2-6 6-3 6-4 in his quarterfinal tie.
Wawrinka, who defeated Andy Murray in the previous round, fought off four match points before eventually being swept aside.
"I think all my game was pretty good, it was one of my best matches for sure, " said Wawrinka.
Potential third- and fourth-round opponents Ivo Karlovic and Stanislas Wawrinka suffered surprise defeats.
"To beat Andy that easy was a big surprise, for sure, " Wawrinka said.
CNN: Nadal 'relaxed' as rivals struggle at Monte Carlo Masters
The 25-year-old Djokovic will play Ukrainian 14th seed Alexander Dolgopolov, who dispatched Stanislas Wawrinka of Switzerland in straight sets.
Even then, as Stanislas Wawrinka learned this tournament, it might not be enough.
There were also victories on Tuesday for France's No. 7 seed Richard Gasquet, Stanislas Wawrinka, seeded 13 and Juan Monaco.
The winner of that match will play either big-serving American second seed John Isner or Swiss No. 4 Stanislas Wawrinka.
In seven matches Wawrinka - who has known Federer since he was 16 - has only beaten his compatriot once.
Berdych triumphed 6-3 6-4 3-6 7-6 (7-5) in more than three hours against Wawrinka, who had beaten Rosol on Friday.
The Spaniard was given a good workout by Wawrinka, ranked 21 in the world, but never looked in any danger.
The tournament, which is not an official ATP Tour event, also featured Russia's Nikolay Davydenko and Federer's Swiss compatriot Stanislas Wawrinka.
Wawrinka, the 18th seed, won 6-4 7-5 against Australian veteran Lleyton Hewitt, who on Saturday beat last year's losing finalist John Isner.
In Oeiras, Stanislas Wawrinka upset top seed and world No. 4 David Ferrer 6-1 6-4 to win the Portugal Open on Sunday.
CNN: Tennis stars Federer and Nadal honor 'a very loved man'
But 14th seed Nicolas Almagro was beaten by Stanislas Wawrinka 6-3 6-3.
BBC: Andy Roddick through to Cincinnati Masters second round
应用推荐