Haas, who beat the world number one at Kooyong this month, looked capable of doing so again, rattling the top seed with his aggressive volleys and ground strokes, forcing an uncharacteristic 58 unforced errors from the Swiss.
The grunting German stormed back from two sets down to take it to a fifth before the world number one composed himself to haul himself back into contention and eke out a 6-4, 6-0, 3-6, 4-6, 6-2 victory in just under three hours.
Despite the close call, Federer said it was good to get a tough match under his belt.
“I played fantastically in the first two sets and he played fantastically in the third and fourth,” he said. “It was tough to break his momentum, I missed a chance to break him in the third. I was serving pretty well, my forehand let me down through the match. But I like to be pushed like this. To win in five sets is a good match for me.”
He will now play Russia’s Nikolay Davydenko in the quarter-finals.
Martina Hingis continued her impressive comeback to a tournament where she reached the final on her last six appearances by beating local hope Samantha Stosur 6-1, 7-6 (10/8), becoming the first wildcard ever to make the last eight here.
But the Swiss miss was also put to the test in the second set with her service game proving vulnerable before she produced fighting tennis to keep her campaign alive, coming back from 2-5 down in the tiebreak.
The 25-year-old triple Australian champion now meets second seed Kim Clijsters in what will be the first real measure of whether she still has what it takes to win Grand Slams.
“Definitely she tries to keep the points as short as possible, and I just have to try to outlast her at this point,” she said of the Belgian.
Clijsters was given an examination by Italian Francesca Schiavone, seeded 15, before winning 7-6 (7/5), 6-4, recovering from 4-1 down in the first set tiebreak.
“I really felt like I had to step it up every time it was getting close and luckily enough I was able to do that,” said the Belgian, who again played with her left thigh heavily strapped.
Amelie Mauresmo though spared no sympathy for 16-year-old Czech Nicole Vaidisova, with a crushing 6-1, 6-1 win in just 52 minutes to reach her 14th slam quarter-final.
In-form Patty Schnyder, Germany’s unfancied Nicolas Kiefer and Sebastien Grosjean of France also won, as did men’s fifth seed Davydenko.
Mauresmo, the third seed, is gaining in confidence and will now take on seventh seed Schnyder, who easily accounted for Russian 12th seed and former French Open champion Anastasia Myskina 6-2, 6-1. Myskina made almost as many unforced errors, 32, as Vaidisova to hand victory to Schnyder, who is playing on her favourite surface, having reached the quarters here last year.
Lindsay Davenport, Justine Henin Hardenne, Maria Sharapova and Nadia Petrova are already into the last eight.
Davydenko won the battle of the super -fit against Dominik Hrbaty, coming from behind to grind out a 4-6, 4-6, 6-4, 6-2, 6-3 win in 3hr 30mins.
Kiefer scored his 300th career victory when he overcame the challenge of Argentine Juan Ignacio Chela in straight sets 7-6 (7/4), 6-3, 6-3.
He will play 25th seed Grosjean, who dispatched compatriot Paul-Henri Mathieu in straight sets. Fabrice Santoro, David Nalbandian, Ivan Ljubicic and Marcos Baghdatis had already booked their places in the last eight.