Federer, an eight-time Wimbledon champion, had not lost a set here since his five-set defeat to Milos Raonic in a 2016 semifinal.
Switzerland's Roger Federer leaves court after losing to South Africa's Kevin Anderson 2-6, 6-7, 7-5, 6-4, 13-11 in their men's singles quarter-finals match on the ninth day of the 2018 Wimbledon Championships at The All England Lawn Tennis Club in Wimbledon, southwest London, on July 11, 2018.
Federer seemed rattled and his forehand began to look vulnerable and it was that stroke which allowed Anderson a decisive break of serve at 3-3 in the fourth.
About five hours later, Federer's rival and foil, second-seeded Rafael Nadal, survived a five-set spectacle against fifth-seeded Juan Martín del Potro, 7-5, 6-7 (9-11), 4-6, 6-4, 6-4.
Djokovic has got his wish as he will take on the world number 24 Kei Nishikori on Centre Court, while Federer will take on Anderson on court number one.
Federer was rattled, but the credit belonged to Anderson, who had disrupted his illustrious opponent's serve.
"I really tried my best to keep fighting", Anderson, 32, told the BBC immediately after coming off court from the 4-hour, 14-minute match. The Swiss lost his serve, putting the match in Anderson's big-serving hands. I believe hard work's going to pay off, because early on maybe I didn't always work at my hardest.
The 20-time Grand Slam champion appeared to be moving towards his 5th successive Wimbledon semifinal after taking the opening two sets.
Anderson became the first South African in the Wimbledon semi-finals since Kevin Curren in 1983 and just the sixth in history. "It's one of those average days you have to try to win the match, and I just couldn't get it done today".
Anderson held his nerve with his relentless and powerful serve win the fourth and send the rip-roaring contest into an unlikely fifth and deciding set.
The 36-year-old had needed only 26 minutes to take the first set, leaving him horrified as a fifth successive Wimbledon semi-final slipped through his fingers from such a commanding position.
Ever since then, Anderson has been improving his game with every passing tournament.
His loss to Anderson was the first match he'd played on Number One Court since 2015. Anderson will take on the victor of Milos Raonic and American John Isner. There's hopefully two more matches still to be played.
Now the 32-year-old South African moves on to face number nine John Isner of the U.S. on Friday. I'm very pleased to get through.
Two-time Wimbledon champion Nadal, who is chasing an 18th Grand Slam title, won the pair's most recent clash in the semi-finals of the French Open last month.
"I am not that good to have the chance to think about all the things going on outside".
He had been yearning for a Centre Court date, after playing as many games on Court Two as the main show court so far this tournament.
Israeli air strikes hit southwest Syria: Damascus state media
The Netanyahu government is detemined to keep fighters loyal to Assad and to Iran out of the Syrian Golan border area near Israel. Syrian military air defenses have repelled an Israeli attack on the country's Quneitra province, Syrian state media report .
Croatia thrive in extra time to reach World Cup final
England should have sewn this game up by half-time, with at least three clear-cut chances to put the game beyond Croatia's reach. While it is players who win matches there can be little doubt that a tactical switch from the canny Dalic transformed the game.