Federer had been favourite to lift a ninth title but will now only be able to watch Sunday's final, where his great rival Rafael Nadal is expected to be one of the combatants.
The big South African's hopes looked forlorn as Federer skipped through the opening two sets on Court One with his usual panache but he turned the match on its head to cause the biggest shock yet in a tournament full of upsets.
LONDON: Roger Federer suffered a stunning Wimbledon exit as the defending champion blew a two-set lead and wasted a match point in a 2-6, 6-7 (5/7), 7-5, 6-4, 13-11 quarter-final defeat against South Africa´s Kevin Anderson on Wednesday.
Six times Anderson was required to hold serve to stay alive and each time he was equal to the task.
And, despite his two-set advantage, the 20-times grand slam victor never looked entirely comfortable, despite having never previously lost a set to Anderson in four other meetings.
"By the end I thought I did a great job not thinking about what was happening".
The first hiccup surfaced at the start of the second set with Anderson breaking the Federer serve and ending that run of holds. "It's not like I would have remembered exactly how it would have felt", Federer said.
Nishikori, playing in his first quarter-final at the All England Club, was bidding to become the first Japanese man to make the Wimbledon semi-finals in 85 years.
More misery for Theresa May as Australia vows to stick by UK
May named one of her most loyal ministers, Jeremy Hunt, to replace Johnson in the job of Britain's top diplomat. But leading pro-Brexit lawmaker Jacob Rees-Mogg said he didn't think she would face a leadership challenge .
The final set lasted 90 minutes, and it was captivating stuff.
"I just kept on telling myself I have to continue believing". That's the mindset you need against someone like Roger.
The Serbian beat Kei Nishikori 6-3 3-6 6-2 6-2 to reach his first semi-final at any of the four tennis majors since the US Open in 2016.
Djokovic, seeded 12th, incurred a warning for throwing his racket and was clearly frustrated, complaining of "double standards" when Nishikori was not punished for a racket throw.
'I don't think it really mattered, to be honest. I think that's not fair.
That will be played at Centre Court, of course, a spot Federer knows well. "I played only once in first four matches on Centre Court".
"I am peaking at the right moment".