Federer then equalled his own record of 34 consecutive sets won at Wimbledon as he went 2-0 up by holding his nerve in a high quality tie-break.
Roger Federer was a point away from a rather tidy, straight-set victory in the Wimbledon quarterfinals.
When Anderson broke again in the fourth, Federer was suddenly on the ropes.
Nishikori capitalised on this lapse in concentration, putting together his finest game of the match to break and then consolidate.
However Djokovic seems to have rediscovered the old fire that powered him to 12 Grand Slam titles and responded well to being pulled back to level sets, tearing through the last two high-quality sets to take the match 6-3 3-6 6-2 6-2.
Friday's fixture will be Djokovic's first major semi-final since he finished runner-up at the 2016 U.S. Open, which also happens to be the last Grand Slam in which Nishikori made it past the last eight. "I hope I can get a chance to fight for a trophy", he said.
"Anybody who saw the match, saw that literally I kind of touched the grass". Kei did the same in the fourth set but wasn't warned.
Djokovic was seen engaged in a heated discussion with the umpire in the aftermath of the warning and it is fair to say some of his comments and complaints have left a sour taste in the mouth of some Wimbledon punters over the course of the championships.
He added: 'With the performances I've had, I deserve to be in the semi-finals.
If Anderson is to shock Federer, who has only lost once before the quarter-finals at Wimbledon in 15 years, he will need to call up the heavy artillery which has served him well at the tournament this year.
Next up for the Spaniard is a blockbuster last four showdown with Serb Novak Djokovic. "I am peaking at the right moment".
A similar situation arose in fifth game of the third set but this time it was the Serbian who saved three break points before he let out a huge roar as the momentum was on his side.
"I just think it's really pathetic".
He came into the match having won 32 consecutive sets at Wimbledon, a run he stretched to 34 before faltering.
Djokovic incurred a warning for throwing his racket and then later complained of "double standards" when Nishikori was not punished for doing the same.
And Nishikori broke in front when a Djokovic drop shot caught the net, as the 24th seed kicked on to draw level in the match.