But Novak Djokovic did rally from two sets down against the big-serving South African. Now, he will have to win a fifth set Tuesday to keep his hopes of a second straight title here alive.
Djokovic's comeback included shaking off a blown 4-0 lead in the second-set tiebreaker. Anderson eventually won that tiebreaker, 8-6, with a drop volley — the same score by which the South African won a first-set tiebreaker. Djokovic convincingly won the third and fourth sets, 6-1, 6-4.
As Djokovic struggled into the dusk of Monday night, four fellow former Grand Slam winners were long gone to dinner, with spots secured in the quarterfinals.
Andy Murray got past a barrage of big serves from the biggest server, Ivo Karlovic of Croatia, before winning and keeping the hopes of the Brits alive for a second men's Wimbledon title in three years. Murray, who won in 2013, beat Karlovic, 7-6 (7), 6-4, 5-7, 6-4.
"It's quite stressful to play against him," Murray said of the 6-foot-11 Karlovic.
Seventeen-time major winner Roger Federer kept coasting along, brushing aside Spain's Roberto Bautista Agut, 6-2, 6-2, 6-3. Federer is seeded second.
Fellow Swiss player Stan Wawrinka, recent French Open champion, beat David Goffin of Belgium, 7-6 (3), 7-6 (7), 6-4, and defending U.S. Open champion Marin Cilic of Croatia ousted the last U.S. male standing, Denis Kudla.
Kudla, a wild-card entrant who made a surprise advance to the fourth round, gave Cilic a good battle.
"This is a good way to start the summer," Kudla said.
Cilic, who won the long match, 6-4, 4-6, 6-3, 7-5, said afterward, "I'm pretty happy it didn't go to five sets."
In other men's matches, Gilles Simon of France took out sixth-seeded Tomas Berdych of the Czech Republic, fellow Frenchman Richard Gasquet slowed down mercurial Aussie Nick Kyrgios, and unseeded Vasek Pospisil of Canada beat Victor Troicki of Serbia.
Pospisil's victory was in a long five-setter, after being down two sets to love. Then he went back out to play doubles with Jack Sock of the U.S. and lost another long five-setter. Jamie Murray of Britain and John Peers from Australia dethroned Sock and Pospisil, who won the men's doubles here last year, by winning the fifth set, 8-6. When Pospisil's day had ended, he had been on the court for 5 hours 58 minutes.
The oft-criticized U.S. tennis program got a nice boost on the women's side, gaining three of the eight quarterfinal spots. While Serena Williams was beating sister Venus for one spot in the quarters, Madison Keys and CoCo Vandeweghe were filling two more.
Keys, from Boca Raton, Fla., is seeded No. 21, but Vandeweghe, unseeded, was the bigger surprise.
The product of Rancho Santa Fe, Calif., had never been past the second round of a Grand Slam event. Her opponent in Monday's round-of-16 match was sixth-seeded Lucie Safarova of the Czech Republic, the French Open finalist last month.
Vandeweghe won, 7-6 (1), 7-6 (4), and was her own worst critic afterward.
"I didn't really feel that good," she said. "It was one of my worst matches of the tournament. But I guess I kept my calm and cool."
Keys beat Olga Govortsova of Belarus, 3-6, 6-4, 6-1, and said she needed to give herself a talking-to after the first set.
"I had a little bit of a slow start," she said, "but I was able to change it around."
Also advancing in the women's bracket were No. 13 Agnieszka Radwanska of Poland, who bounced out the player who had bounced out the defending champion. Serbia and Rancho Santa Fe's Jelena Jankovic, fresh from her Centre Court stunner over Petra Kvitova, yielded to Radwanska, 7-5, 6-4.