Eventually, Nadal took the set and the match on serve, despite numerous attempts from Del Potro to force another break.
Top seed Federer, 36, had not dropped a set on his way to the last eight.
He equalled his own record of winning 34 consecutive sets at SW19 by taking the the first two against Anderson.
When Federer gets up 2-0, you don't think it's going to be a full five sets. Anderson leveled for 7-7, 8-8, 9-9, 10-10.
In four previous matches against Federer, Anderson had not won a set.
Djokovic appeared to feign hitting the ball in the umpire's direction toward the end of his four-set win. I thought I settled down much better in the second set.
Only once before had Federer played more games at a Grand Slam and on that occasion, he prevailed 16-14 in the 2009 Wimbledon final against Andy Roddick. Djokovic will play Rafael Nadal in the last four on Friday, thanks to the latter surviving Juan Martin del Potro in five sets. "Even if the matches have been maybe sometimes one-sided. you always know he can pick it up, and all of a sudden you won't see breaks for some time.". He wastes three set points and gives one to Anderson, instead.
"I have already gotten tons of messages from support back home", Anderson said.
Unfortunately, 2018 Wimbledon's second Wednesday was going to witness one of biggest upsets of the year. Anderson will take on the victor of Milos Raonic and American John Isner. However, he fell once, this time in a 7-6 tiebreaker, to fall behind two sets to none.
Isner rallied behind a dominant first serve, converting 73 percent of them and winning those serves at an 80 percent clip. His serve, which had been practically infallible through three rounds, was broken three times. Of course, the goal is to come back here next year.
Djokovic defeated 24 seed Kei Nishikori in four sets on Wednesday at Wimbledon, 6-3, 3-6, 6-2, 6-2, to advance.
Anderson, a three-time All-American at IL, moves onto the semifinals of Wimbledon for the first time in his career. The same year, he made it to his first Grand Slam quarter-final, which was at the US Open. Since then, it has been a long rehabilitation process.
Federer was completely out of sorts by now and his uncharacteristic struggles on his forehand didn't improve in the fourth set.
Djokovic will play Nadal in the semifinals. "It's not like I would have remembered exactly how it would have felt", he said.
"I was actually playing really high-quality tennis, having a few sniffs on his serve, nearly felt my mind wondering, Well, maybe I can do this". Djokovic broke Nishikori's serve seven times, and finished with six aces.
Anderson never had made it beyond the fourth round at Wimbledon until this week, carried by his booming serve.