NEW YORK (AFP) - Four-time defending champion Roger Federer and 2007 runner-up Novak Djokovic survived five-set scares from stubborn fourth-round opponents Tuesday at the 20.6 million dollar US Open. Federer, whose 12 Grand Slam titles are two shy of Pete Sampras's all-time record, extended his US Open win streak to 31 matches by beating Russian Igor Andreev 6-7 (5/7), 7-6 (7/5), 6-3, 3-6, 6-3. An ailing Djokovic had to dig equally deep while playing through a sore right hip to defeat Spain's Tommy Robredo 4-6, 6-2, 6-3, 5-7, 6-3. "Novak got a tough one too," Federer said. "You always wish for three sets but honestly those five-setters are fun." Federer advanced to the quarter-finals where he will play Luxembourg qualifier Gilles Muller. The other quarter-final in that half of the draw features Djokovic against American eighth seed Andy Roddick, who breezed past Chile's Fernando Gonzalez in Tuesday's late match 6-2, 6-4, 6-1. Federer said he's not worried about facing an underdog on a roll in the next round. "It is just a guy who has got even less to lose," Federer said of Muller. "It has been like this for the past 4 1/2 years." Federer, trying to salvage a sub-par season after years of Slam domination, hadn't dropped a set in his first three matches, but Andreev made him work for the victory. It is rare to see Federer in a five-set match at the US Open but this hasn't been a normal season for the former world number one. Close matches makes life more interesting and gets the competitive juices flowing, he said. "I don't remember ever playing an entire five-set match on centre court here," said Federer, who has actually played three five-setters at the Open. "I was always winning easily. It is different and fun to be in a dog fight." Federer had trouble getting untracked in the first set. It wasn't until he got his serve going and began charging the net that he began to chip away at the hard-hitting Russian, who came into the US Open with a career-high No. 23 ranking. With his normally reliable forehand stuttering and his body failing him, Serbian Djokovic also had to rally from an opening set loss to Robredo. Djokovic, who now leads the career meetings with Robredo 4-1, raised both arms into the air as the last ball was struck and then pointed to his heart, knee and head as a crowd of 10,000 at the Arthur Ashe Stadium stood and cheered. "I need to stay next to the net otherwise I will fall down," Djokovic said immediately after the match. "Really. It was an incredible match." An exhausted Djokovic said he is still feeling the effects of his previous match. "If I start talking about the things that are bothering me now, we can talk about this until tomorrow," Djokovic said. "Whoever I play next will be physically fitter than me that's for sure." Robredo took a spill of his own in the fifth set, rolling near the baseline while lunging for a shot. Robredo accused Djokovic of exaggerating injuries to get some extra rest."If you are not fit enough then don't play," Robredo said. "I have pain all over my body but I don't complain." Former champion Roddick easily disposed of Gonzalez in straight sets as he tries to get back to the final of the tournament he won five years ago. Roddick said he is looking forward to the challenge of playing Djokovic, who he beat in Dubai for one of his two titles this year. He also joked about being older than third-seeded Djokovic. "I got to feel good because he has about 16 injuries right now." Roddick said. "His next opponent (Roddick) is a lot older than him."Novak has made himself one of the elite players. I just got to try to get the upset." Luxembourg's Muller became the first qualifier since 2000 to reach a Grand Slam quarter-finals by surprising Russian fifth seed Nikolay Davydenko 6-4, 4-6, 6-3, 7-6 (12/10).