Eighth-seed Anderson, 32, saved a match point in the 10th game of the third set and grew in confidence against an increasingly-ragged Federer who had won the first set in 26 minutes.
"It's disappointing losing the next two sets after winning the first two and having match points", said Federer.
Federer, playing in the unfamiliar surroundings of Court One for the first time in three years, oozed confidence as early as the opening game when he broke Anderson's huge serve easily and then again in the ninth game before serving out the set in 26 minutes.
Federer, the eight-time champion, took the first two sets 6-2, 7-6 (5) on Court No. 1 to extend his streak of winning 34 straight sets at the All-England Club.
Anderson stayed in the match thanks to his serving, compiling 28 aces.
This will be their first meeting on grass, and Nishikori said: 'I think it's going to be a new game for us.
But Federer offered a contrasting view in his media conference following a 6-0 7-5 6-4 fourth-round win over Adrian Mannarino on Monday.
From Wimbledon and ICC, it has now moved over to Roger Federer and Sachin Tendulkar as the two legends discussed helping each other out with their trademark shots on the tennis court and cricket field respectively.
This was not vintage Federer, even in the first set which he won handily. It's one of those average days you have to try to win the match, and I just couldn't get it done today.
Trump administration slashes more ObamaCare funds
President Donald Trump departs after speaking at a Make America Great Again rally in Great Falls, Montana, U.S., July 5, 2018. In other words, the Trump Administration position in court is in favor of making the payments .
Former Bengal 'Pacman' Jones involved in airport brawl
Daugherty says that at some point during the fight, Ragin ended up hitting a woman who was with Jones, injuring her hand. TMZ Sports obtained the video, which shows the airport employee verbally accosting and then physically attacking Jones.
Operation resumes to free remaining 5 from Thai cave
Thailand's navy SEALs say the four boys and coach rescued on Tuesday, after other rescues in the previous two days, are all safe. Mr Narongsak said he was grateful for Mr Musk's support but the equipment was impractical for the rescue mission.
Federer immediately went up 40-0 on the Anderson serve in the opening game, taking the second of three break points when the eighth seed hit a backhand wide before easily holding to love. This was also Anderson's first appearance in the Wimbledon quarterfinals, becoming the first South African man to do so since Wayne Ferreira reached the last eight in 1994.
Nadal faces the victor of Juan Martin del Potro and Gilles Simon while Federer takes on US Open finalist Kevin Anderson in the quarterfinals.
But he found himself in even more unfamiliar territory with an inspired Anderson's relentless, thudding serve eventually overpowering the 20-time grand slam victor.
After a slump following two years of nearly total domination of the men's game, Djokovic's star appears to be back on the rise and he is a clear contender to win a fourth Wimbledon title.
"That's how important Wimbledon is to me and to us over here".
Federer's bid to win a ninth Wimbledon title came to an astonishing end as the Swiss star collapsed in a nail-biting four hour and 13 minute classic that ranks as one of the tournament's greatest upsets.
"I don't think it really mattered, to be honest".
They remained on serve early in the fifth set, as the match passed the three-hour mark.