On they went, both holding to love for 10-10, but at 11-11 it was Federer who blinked first, a double fault handing Anderson a rare break point which he converted.
"I'm not quite sure what to say, I had to try my best to keep fighting", Anderson told the BBC. That's the mindset you need against someone like Roger. I wasn't - how do you say - horribly negative the whole game. "Matches likes that are very special".
With Wednesday's other two quarterfinals between world No 1 Rafael Nadal and Juan Martin del Potro and three-time champion Novak Djokovic against Kei Nishikori given star billing, Federer was shunted off Wimbledon's Centre Court for the first time in three years - and 21 matches.
But Federer refuted the suggestion that he might not be back next year to add another trophy to his cabinet.
The longest streak of service games won at the All England Club was Pete Sampras's 118, set between the third round in 2000 and the second round in 2001.
Anderson was sticking to his guns, though, and after saving match point the eighth seed secured another break of the Federer serve and snatched a set back.
Federer previously won 34 straight sets between the third round in 2005 and the final in 2006 but records were the last thing on Federer's mind as he just thinking of making it through to the last four unscathed. And it was Federer who blinked, double-faulting to face a break point at 11-all, then slapping a forehand into the net to cede the key break.
Six times Anderson was required to hold serve to stay alive and each time he was equal to the task.
Anderson kept his nerve to beat a top-five player for the first time since 2015 and Federer admitted his frustration at not being able to get the job done.
Anderson, 32, is the first South African man to make the last four at Wimbledon since Kevin Curren in 1983.
The final last-eight clash is unlikely to feature too many rallies, with John Isner taking on Milos Raonic.