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.
"I just kept on telling myself that I had to keep on believing".
The top-seeded Federer double faulted for the first time in the match when serving at 11-11, 30-30. Anderson held for 5-all, broke to 6-5 with a violent return victor off a 156kph second serve, then staved off three break points and closed the set with a 214kph ace.
He will next face either two-time champion Rafael Nadal or fifth-seeded Juan Martin del Potro.
Anderson had 28 aces in the match, but he is not just a big server. Djokovic last appeared in the semifinals at Wimbledon in 2015, when he won.
But, playing on Court One for the first time in 3 years, Federer was unusually error-prone and became visibly frustrated as 8th seed Anderson refused to surrender.
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. The last time was at the semifinals of the US Open in 2011 against Novak Djokovic.
That initial burst gave Federer 34 successive sets won at Wimbledon, equalling his own record set between 2005 and 2006. He was also hitting more winners off groundstrokes, while small errors started creeping into the Federer game. Raonic never broke Isner's serve, and while Isner broke Raonic's serve just three times, it was just enough to move on.
In their four previous meetings Anderson, 32, had not taken a set off Federer.
Locals awed after Thai cave rescue captured world's attention
A message posted on the English Premier League club's Twitter account said: "Our thoughts and prayers are with those affected". Officials said the boys, many of whom had never learned to swim , were given anti-anxiety medication to keep them calm.
Meanwhile, after dropping the second set to Nishikori, Djokovic wrested back the momentum for good in the third, coming from 0-40 down at 2-2 to hold serve. It rattled Federer, who blew the next match point and then double faulted on break point.
Cape Town - Kevin Anderson says a few adjustments in his fitness regime helped him maintain a good physical state in his quarter-final win over Roger Federer at Wimbledon.
"I've been building in the past couple of weeks".
'I was glad and grateful to be scheduled today on the Centre Court, playing first match. "I've actually been a little bit more aggressive this tournament in terms of some of the strength I've done on the off days, which I think has been beneficial", he said.
"I feel like I'm peaking at the right moment". "I think I had my chances, so it's disappointing". That's my problem really, the 36-year-old said.
Earlier in the day, Novak Djokovic ended his near two-year absence from grand slam semi-finals by booking a place in the last four at Wimbledon. He missed the second half of last season with an elbow injury.
Now Federer must go back to the drawing board for a new plan, if he wants to stop that from happening. I just asked him whether he thought honestly that I damaged the court with the racket.
"I have been here before and I will try and enjoy this victory".
"Anything could have happened, so this is a big achievement for me to get to the semi-finals at Wimbledon".