After dropping the opening set in his first two matches, Nadal trailed 4-2 and was down a break at 6-5 before surging ahead for his 18th consecutive victory.
Nadal seeks to become first man to win eight titles at the same Grand Slam event. He improved to 55-1 at Roland Garros despite enduring some wobbly moments for the third match in a row.
Nadal committed 40 unforced errors and faced 11 break points. He next plays No. 13-seeded Kei Nishikori, who became the first Japanese man in 75 years to reach the fourth round at Roland Garros, beating Frenchman Benoit Paire 6-3, 6-7 (3), 6-4, 6-1.
Paire had a set point while leading 5-4 in the second and Nishikori serving. But Paire was given a point penalty by chair umpire Enric Molina for coaching, which is not allowed at Grand Slam tournaments, and Nishikori wound up holding serve.
Paire did manage to win that set, anyway, but he was broken in the last game of the third when he missed a drop shot.
Paire said later that his coach, Lionel Zimbler, was merely putting his hands in the air to offer encouragement. Zimbler moved both hands forward in a kind of pushing motion.
"For sure, it's not fair. You see every coach do the same thing," Paire said. "If it's the best player in the world, (Molina) doesn't (give a) warning."
Nishikori said he didn't see it.
"I didn't know what's happening in the match," Nishikori said. "They didn't explain (it to) me, and I didn't care. ... I was just trying to concentrate (on) myself."
Japan's Fumiteru Nakano lost in the fourth round in Paris in 1938. Nishikori acknowledged that he had never heard of him.
"Sorry, I'm not good at history," he said, playing down the significance of reaching the fourth round. "I'm seeded 13 here, so I have to kind of go through these couple (of) rounds."