But Anderson finally made the 20-time Grand Slam champion look human in unfamiliar territory on Court One, where the Swiss had not played in three years. Anderson, after saving a match point on his serve in the 10th game, broke Federer's serve in the ensuing game and then clinched the set with a final service hold.
In their four previous meetings Anderson, 32, had not taken a set off Federer.
The Spaniard finished with 67 winners to 34 unforced errors as he displayed his credentials as he bids to lift a third singles title at the All England Club.
What an upset. This one had a taste of an easy victory after the first two sets.
Federer battled back from 0-3 down to force a tie-break, where Anderson grabbed a 2-0 head-start. Not Roger Federer, certainly not the 11,393 fans who had tickets for No 1 Court and probably not Kevin Anderson, who played the match of his life. The score flipped a Federer set point to a Del Potro break point, which the Argentine quickly converted.
Federer seemed to be heading for a routine victory with match point to complete a straights set win in the third.
Yet once he had ended Federer's run of holding serve for 85 consecutive games - a streak dating back to last year's semifinal- Anderson's confidence soared.
The only other times he has surrendered a two-set lead came against Lleyton Hewitt in Switzerland's 2003 Davis Cup semi-final loss to Australia in Melbourne, to David Nalbandian in the 2005 Masters Cup decider.
Serving at 5-6, Anderson fell behind Love-30, which put Federer two points form defeat.
It was Federer who faltered at 11-11, double-faulting to hand Anderson a break point which he converted when the defending champion's tired forehand smacked the net.
He is also the first Japanese man to reach the quarter-finals since Shuzo Matsuoka in 1995.
Federer had been pursuing a 13th Wimbledon semi-final and a 44th appearance in the last four of a grand slam.
"I think it was great quality tennis and in the final set there were some fantastic points", said 2008 and 2010 champion Nadal.
"It was just one of those days where you hope to get by somehow", Federer said.
"I think just the more experience you get, just managing these sort of matches, managing your body better".
"You really need that mindset taking the court against somebody like Roger. I just gave it my all and I'm ecstatic to get through that".
Later in the match, Djokovic was clearly frustrated and complained of "double standards" when Nishikori was not punished for a racket throw.
" I think I had chances, I'm not sure exactly how many".
They were playing on Court No. 1 - Federer's first match away from Centre Court since the same stage of the tournament in 2015. I think that was the key at the end.
How hard was it to see this coming?
His absence paves the way for his arch rival, Rafa Nadal, to win a third Wimbledon title, which would narrow the Grand Slam gap between the sport's best players.
"That was very important", he added.
He said: 'I felt like in the last month and a half, the level of tennis has been very close to where I would like it to be, where I'm used to having it.
- Attorney: Ex-FBI lawyer Page won't show for House interview
- Man harasses woman over Puerto Rico shirt, says it’s ‘un-American’
- The US has just one Blockbuster left
- Couple having affair die from carbon monoxide poisoning during sex
- Trudeau Government Shares Concern with Trump on Russian Pipeline to Germany
- The queen checked her watch while waiting for Donald Trump
- Meghan Markle and Serena Williams' friendship ahead of Wimbledon final
- Players demand 5th set tie-breakers after 400-minute marathon
- PGA Tour Announces Changes to Season Schedule for 2018
- Prince Louis christened at intimate service in London