Nadal will face either Croatian third seed Marin Cilic or Juan Martin del Potro, the fifth-seeded Argentine, in the semi-finals.
"It was a very difficult match, Diego is a good friend and a good player," said the 16-time Grand Slam champion.
"After the stop for rain I played more aggressively and I'm very happy to be back in the semi-finals here."
It is the 11th time the 32-year-old Spaniard has reached the French Open last four, becoming only the third man in history to achieve the feat at a Grand Slam tournament, after Jimmy Connors at the US Open and Roger Federer at Wimbledon and the Australian Open. Nadal returned to the court midway through serving to level the match after bad weather ended play early on Wednesday evening.
The struggles he faced on Wednesday in losing a set at Roland Garros for the first time since 2015 were put to bed during the second day of the match, as he broke 11th seed Schwartzman's serve four times in the final two sets to ease through.