The 2009 Australian Open winner turned around the first set -- and ultimately the match -- in the 11th and 12th games. Nadal fended off five break points to hold, and then broke the 6-foot-8 South African's serve in the next game to go on a roll in his fourth-round encounter.
"Today was the best match so far this tournament, no doubt about that," Nadal said. "I'm starting to feel more comfortable with my movements, with my forehand, so that's the only way that I have any chance to have success on the tough matches "
In other action Sunday, Nick Kyrgios came back from two sets down and saved a match point to beat Andreas Seppi 5-7, 4-6, 6-3, 7-6 (5), 8-6, becoming the first Aussie to reach the last eight in Melbourne Park men's draw since 2005, and the first male teenager since Roger Federer to reach two Grand Slam quarterfinals.
Kyrgios' first words to a packed Hisense Arena, where the crowd yelled and screamed like football fans: "Thanks mate. Feels so good."
Nadal, who lost in the Australian Open finals in 2012 and last year, is coming off an extended injury layoff and says he's building momentum as he goes -- thankful he got through a tough five-setter in the second round against U.S. qualifier Tim Smyczek.
"The chance to be in the quarterfinals after a tough period of time for me is a fantastic result," said Nadal. "I was playing better than the days before. I felt myself with better rhythm in the legs, better rhythm with my forehand. The way that I improved my level is not the most important thing; obviously the victory is."
Nadal had to laugh in his last game as he tried to ignore a distraction when his water bottles -- famously always precisely placed near the side of the court either for routine or superstition -- tumbled over and a ball boy repositioned them.
"Seriously it's not bothering me," he said.
The two-game turnaround appeared to deflate Anderson, who won only five more games in the match.
Seppi beat Federer in the third round -- the 17-time Grand Slam winner's earliest exit in Melbourne in 14 years -- and was on course to reach the quarterfinals for the first time in 40 majors.
But 19-year-old Kyrgios had experience in coming back from 0-2 -- he did that at Wimbledon, where he also upset then No. 1-ranked Nadal en route to the quarters.
"I know that he had a lot of confidence, obviously, beating Roger," Kyrgios said. "Drawing all my experience from Wimbledon, coming back from two sets down, I knew I had the legs to do that."
Berdych reached the quarterfinals for the fifth consecutive year with a 6-2, 7-6 (3), 6-2 win over local hope Bernard Tomic.
With his new fiancée Ester Satorova watching from the stands, the seventh-seeded Berdych hit 52 winners and broke Tomic four times to advance to a matchup with Nadal.
Berdych reached the quarters for the third straight year without dropping a set. He advanced to his first Australian Open semifinal last year, but lost to eventual champion Stan Wawrinka.
Nadal has an 18-3 record over Berdych and hasn't lost to the Czech player since 2006.
Berdych said, "I'm going to try to fight to the last point and bring something extra from myself."
The Associated Press contributed to this report.