(CNN) -- Roger Federer remains on course for a record 14th Grand Slam title after a fierce fightback saw him recover from a two-set deficit to defeat Tomas Berdych 4-6 6-7 6-4 6-4 6-2 and reach the Australian Open quarterfinals.
Swiss star Roger Federer celebrates a comeback victory to reach the Australian Open quarterfinals in Melbourne.
Swiss former world number one Federer needed almost three-and-a-half hours to overcome a dogged opponent and now faces eighth-seeded Juan Martin Del Potro
The 20-year-old Argentine also had to come from behind to oust Croatia's Marin Cilic 5-7 6-4 6-4 6-2 in Sunday's action.
American Andy Roddick, the seventh seed, is also through to the last eight after a 7-5 6-1 6-3 win over Spain's Tommy Robredo, the 21st seed.
Roddick now faces holder Novak Djokovic in the last-eight after the third-seeded Serb ousted Marcos Baghdatis, the 2006 runner-up, in the late-night clash.
Djokovic raced through the encounter 6-1 7-6 6-7 6-2 and still finished at 2:26 am. "We waited three-and-a-half or four hours to get on the court so it was really hard to warm up," he said.
Federer earlier looked in big danger of failing to reach the quarterfinals of a grand slam for the first time since the French Open in 2004, but insisted there had been no sense of panic.
"I wasn't thinking of losing, that's for sure," he said. "The finish line was still very far for Tomas. I knew that.
"I kind of felt after a terrible first set from my side that if I probably want to win this it's going to go to five sets -- that's what made me be so determined towards the end.
"It was nice being in a battle with him. It was fair play. It was tough, good tennis towards the end. I believed in it all the way, and I think that was key in the end."
There were 11 breaks of serve, with Federer hitting 61 winners to the Czech's 58. But the most telling difference was the number of aces with Federer firing down 20 and Berdych just eight.
Second-seeded Federer dropped serve in the opening game and was broken again in the fifth as Berdych made an immediate impact. Federer took the opening two games in the second, but his rival recovered and went 2-0 up on the tiebreak
Federer got the vital break of the third in the seventh game and won the set with an ace, but he had to battle in the fourth after Berdych took a medical time-out for treatment to a hamstring.
The world number two then raced to a 5-2 lead in the final set before sealing his great escape with two aces.
Del Potro, at 20 the youngest man in the top 10, had less difficulty against Cilic and after handing him the first set with a double fault.
Roddick stretched his run of victories against Robredo to 10 consecutive matches with his win.
A netted forehand by the Spaniard gave the American the opening set and from there it was plain sailing for Roddick, who fired 13 aces and 34 winners.
Roddick will play the winner of the night match between Novak Djokovic and Marcos Baghdatis.
In play on Saturday, world number one Rafael Nadal brushed aside Germany's Tommy Haas 6-4 6-2 6-2, while fourth seed Andy Murray was equally impressive in dispatching Jurgen Melzer of Austria 7-5 6-0 6-3.
But the match of the day in the men's draw was Chilean 13th seed Fernando Gonzalez's five set, four-hour victory over Richard Gasquet of France.
Gonzalez, who had to come from two sets down and a match point in the third to record a 3-6 3-6 7-6 6-2 12-10 win, will now face Nadal for a spot in the quarterfinals.
Gonzalez, the runner-up to Roger Federer in 2007, will have to be at his very best to test Nadal, who overpowered Haas with his strong groundstrokes.
The Spaniard, chasing his first Australian Open victory, found himself 2-0 down early in the match, but broke back immediately and then in the fifth game to assume control -- which he never relinquished.
Murray next takes on Spanish 14th seed Fernando Verdasco, who was a comfortable 6-4 6-0 6-0 winner over Radek Stepanek of the Czech Republic.
On a good day for the leading seeds, fifth-ranked Jo-Wilfried Tsonga of France, the runner-up last year to Djokovic, beat Dudi Sela of Israel.
Tsonga, who had to fight hard for a 6-4 6-2 1-6 6-1 victory over the qualifier, will face American ninth seed James Blake.
Monfils will play fellow Frenchman and sixth seed Gilles Simon, who dismissed Mario Ancic of Croatia.