Federer, an eight-time Wimbledon champion, had not lost a set here since his five-set defeat to Milos Raonic in a 2016 semifinal. In a fascinating final set, it took 24 games for the two to be parted; the South African claiming a 13-11 win after a match that lasted 4 hours and 13 minutes in total.
Federer was 4-0 against Anderson entering the day, winning every set they'd ever played against each other.
With things on serve and Federer leading 5-4, Anderson survived a match point to hold serve for 5-5 then broke immediately and served out the set, winning it 7-5. Breaking Federer was going to be his biggest challenge, as prior to Wednesday's match the Swiss had gone 81 service games without dropping serve. Against Anderson, though he hit 16 aces, it was down to 79 %.
Federer's first double fault of the match was perhaps the most costly error either player made. The 2017 U.S. Open runner-up triumphed in 4 hours and 14 minutes. 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.
"I just kept on telling myself I have to continue believing".
Kevin Anderson took deep breaths, big gulps of the early-evening air as he paced the court, preparing to serve for a place in the Wimbledon semifinals.
Federer took the first two sets and then the South African returned strongly to take the third and fourth sets. "Beating Roger Federer here at Wimbledon will be one I remember, especially in such a close match", Anderson said.
That took great self-belief, he added, knowing that he had never taken a set off 20-time major victor Federer in four previous meetings.
Now, at age 32, he has reached the semifinals at Wimbledon for the first time.
Anderson then served it out, ending things with a 205kph service victor, and raised both arms overhead.
Unsurprisingly, Anderson says his win over Federer will be one he cherishes for a long time.
Three-time champion Novak Djokovic, meanwhile, reached his first semi-final at the majors in more than two years by seeing off Japan's Kei Nishikori 6-3, 3-6, 6-2, 6-2. "I don't think it's fair but it is what it is".
Next up for Anderson is a semi-final on Friday against either John Isner, the ninth seeded American. I scraped through the third and fourth sets.
Rafael Nadal has a bit of that on his side, with the world No.1 the sole player from the top seven in the men's rankings to reach the semi-finals.
"He's not going to stay around forever but there's no reason for him not to come back one more year at least".
"I don't think it really mattered, to be honest", he said.
Federer, who had played his last 20 matches on Centre Court, stretching back to 2015, continued to enjoy the full backing of his ever-growing fandom on Court No.1.
"Well, maybe wasn't my best, but I thought I was playing good enough", said Nishikori.