Eyeing a ninth title at The All England Club, Federer ultimately paid the price for being unable to convert any more than three of 12 break-point chances in the four-hour, 14-minute cliffhanger on Court One.
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.
"But, sure, I was also surprised it was that fast, that first set, especially 16 minutes". Anderson held for 5-all, broke to 6-5 with a violent return victor off a 97 miles per hour second serve, then staved off three break points and closed the set with a 133 miles per hour ace.
That meant Federer had equalled but not bettered his previous best set-winning streak which came between the third round in 2005 and the final in 2006. But that turned out to be the least of his worries.
What an upset. This one had a taste of an easy victory after the first two sets.
Federer responded, quickly breaking back before taking the set in a tie-break.
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.
Djokovic secured that game with a forehand victor, then saved two game points on Nishikori's serve before converting his first match point with a forehand down the line.
The decider went on serve deep into double figures, before Anderson broke in the decisive 23rd game to set up a chance to serve the match - a chance he duly took.
Two-time champion Nadal is through to the last eight at Wimbledon for the first time since 2011.
'I think there was a real hope his elbow could heal naturally, holistically.
Our recommended way to watch Roger Federer online without cable is via Hulu Live TV with Wimbledon coverage. "I kept on telling myself, keep believing, today is my day". That's the mindset you need against someone like Roger.
But Anderson was just getting started. Reaching his first grand slam final at the US Open a year ago, where he lost to Nadal, gave him great confidence and it was noticeable even early on that he was able to push Federer back, a rare sight, especially on grass.
Djokovic overcame a series of rows with the chair umpire to record a 6-3 3-6 6-2 6-2 victory over Japan's former US Open finalist.
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.
Djokovic, seeded 12th, incurred a warning for throwing his racket and was clearly frustrated, complaining of "double standards" when Nishikori was not punished for a racket throw. Shouldn't really happen, but thankfully they do for me.
"He said he thinks it damaged the court".