Defending champion Federer yesterday lost a Court One thriller, 2-6 6-7 (5/7) 7-5 6-4 13-11, as 32-year-old Anderson became the first South African in the Wimbledon semi-finals since Kevin Curren in 1983.
"Down two sets to love I tried my best to keep fighting. Beating Roger Federer here at Wimbledon will be one I remember, especially in such a close match," Anderson said.
In a nail-biting four hour and 13-minute classic, it was 36-year-old Federer's earliest exit at the All England Club since his shock second-round defeat against Sergiy Stakhovsky in 2013.
"Sometimes you don't feel good, and you try your best. Today was one of those days. I didn't see it coming," said Federer.
"I had moments where I was great, I felt like I was reading his serve, other moments where I don't know where the hell I was moving to.' Eighth seed Anderson will play American ninth seed John Isner tomorrow for a place in Sunday's final.
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.
The 12-time Slam champion will face old rival and world number one Nadal who saw off Del Potro 7-5 6-7 (7/9) 4-6 6-4 6-4 after four hours and 48 minutes on Centre Court to reach his sixth Wimbledon semi-final and 28th at the majors.
The victory gave Nadal his 11th win in 16 meetings against the fifth seed Del Potro as the Spaniard stayed on course for an 18th Grand Slam title.