Top seed Federer, 36, has now won 32 consecutive sets at Wimbledon, just two behind his record set from the third round in 2005 to his title triumph in 2006. He then broke the serve of his Japanese opponent in the next game.
As the fifth set became as much a test of mental strength as anything, from 4-all to 6-all to 8-all to 10-all, Anderson was as steady as he needed to be. However, this is the first meeting between the two on grass.
When Anderson broke again in the fourth, Federer was suddenly on the ropes.
But, Anderson, the 2017 US Open runner-up, rallied and fought back to level things before prevailing in a marathon final set to triumph 2-6, 6-7, 7-5, 6-4, 13-11. The 20-time Grand Slam champion said he didn't want to waste time and was ready to take notes. Those are the kind of circumstances that you just have to accept.' He also revealed: 'Post-match I heard that the organisers were planning to cancel my match if Monfils and Anderson went to a fifth.
Organizers also made a unusual choice as the mixed doubles match featuring Jamie Murray and Victoria Azarenka against Anna-Lena Groenefeld and Robert Farah was moved to Centre Court, instead of Djokovic-Khachanov.
"It was an important victory as since 2011 I have not been in the quarter-finals of Wimbledon. Maybe you should ask the questions over in Russian Federation, how they're going to feel about Wimbledon being played at the same time".
The Swiss refused to blame his surprise defeat on the decision to play the match on Court One rather than his customary Centre Court stage at the All England Club. He had headed to London on the back of some commendable performances at Rome Masters and more recently, Queen's where he reached the final. "It's not like I would have remembered exactly how it would have felt", he said.
Djokovic is a 12-time major champion who's been in something of a rut, due to right elbow troubles that lasted more than a year until he finally had surgery in February.
Tendulkar, who is regular at Wimbledon finals, also expressed his regret at not being able to see Federer play this year.
Federer, playing in the unfamiliar surroundings of Court One for the first time in three years, oozed confidence as early as the opening game when he broke Anderson's huge serve easily and then again in the ninth game before serving out the set in 26 minutes. Watch out for del Potro's booming forehand winners!
The battle between the two big-servers will start on Court 1 after the first quarter-final between Federer and Anderson.