Anderson came from two sets down to beat the eight-time Wimbledon champion 13-11 in the fifth and pull off a famous upset.
Federer, the No 1 seed, had been widely expected to cruise through to the final before facing the likes of Rafael Nadal or Novak Djokovic.
But it will instead be the South African who faces John Isner or Milos Raonic in the semi-final and Federer will be left to lick his wounds and consider where it went wrong.
“I didn’t see it coming. From that standpoint, I felt great in practice, good in the warm-up,” Federer said in his post-match press conference.
“I’m feeling the ball well. Even now losing, I still felt like the feeling is there.
“It just happened to be that today wasn’t the day.”
Federer had not dropped a set on his way to the quarter-finals and looked set to continue that run when he took the second set tie-break just 78 minutes into the contest.
The 36-year-old even had a match point saved in the third and admitted that moment felt like a turning point.
“I wouldn’t necessarily say I’ve been playing like incredible. I’ve been playing well,” Federer added.
“Just today, when I needed it, I couldn’t get it up. That’s why it’s an average performance and not a good one.
“So if I would have won in straight sets, then it could have been all right, because I would have had a great first set, and second set was whatever it was.”
He also said: “Every second game is an average performance I believe.
“Then you have moments in the match where you rise to the occasion and play very well.
“I was very happy that I got off to the right start of the match, was able to take control somewhat of the game.
“I just don’t know exactly how I couldn’t create more opportunities once the third set came around.
“I think I had chances, I’m not sure exactly how many.
“But then fourth and fifth, obviously the fifth was long, that’s like two sets, the fifth.
“I think I had my chances, so it’s disappointing.
“No doubt about it. He was consistent. He was solid. He got what he needed when he had to. Credit to him for hanging around really that long.”
Source : EXPRESS