Serving at deuce and 3-4, Anderson yanked Federer from one corner of the court to the other with blistering groundstrokes until the Swiss ended the 21-shot rally by netting yet another backhand.
Anderson staved off Federer's first and only attempt at match point, trailing 5-4 in the third set, before winning the game to tie the set at 5-5 and ultimately winning the next game to take a 6-5 lead.
Anderson hit 13 winners and just four unforced errors in the fourth set as he claimed the only break to force a decider. Still the focus was on the big three in the men's draw - Federer, Novak Djokovic and Rafa Nadal - but Anderson believed he could surprise many with victory, constantly talking to himself throughout the game. Federer held on the match and set point.
Nishikori, who had won only two matches in 15 meetings with the 12-time major victor, broke for 1-0 in the fourth but was broken straight back. "It just happened to be that today wasn't the day".
Likely Impact of US-China Trade War: Prices Up, Growth Down
In June, the British leader warned both Trump and European Union leaders of the dangers of entering a tit-for-tat trade war. On Thursday, Commerce Ministry spokesman Gao Feng hit back at "threats and blackmail" ahead of the planned USA tariff hike.
Federer took the first two sets and then the South African returned strongly to take the third and fourth sets. It set Federer off - he remained heated by the overturn ("That one cost me the match, eventually", Federer said later) and he began jawing at the chair umpire to complain about a number of things, including how long Del Potro was taking to challenge.
Federer, whose form here made it look increasingly likely he would become the first man in the professional era to win five Grand Slam titles after the age of 30, said fatigue had not been a factor even when the match went into its fifth hour.
Anderson's next opponent will come Friday against No. 9 seed John Isner, who made his first ever semifinal with a win over Milos Raonic.
His loss to Anderson was the first match he'd played on Number One Court since 2015.
Now the 32-year-old South African moves on to face number nine John Isner of the United States on Friday.
It is timed for release as the anticipation crests with Roger as returning champion, 10 years after their famed 2008 Wimbledon championship - an epic match so close and so reflective of their competitive balance that, in the end, the true victor was the sport itself.
Van der Sar backs Belgium for World Cup glory
Commentators seem to agree that the current young England team have been playing intelligently and with discernible teamwork. In the photo, the words have been changed to " Gareth Southgate Street", in tribute to England manager Gareth Southgate.
From space the Kepler telescope runs out of fuel
The data from this mission will help astronomers to confirm previous exoplanet candidates, as well as find any new candidates. The decision to put Kepler into the hibernation-like state was due to a recent "indication" that it is "very low" on fuel.