The Mallorcan surpassed John McEnroe’s previous record of 49 consecutive sets on carpet which had stood since 1984 by seeing off 13th seed Schwartzman and claiming a 21st consecutive win on clay.
Nadal will face Austrian Dominic Thiem in the last eight on Friday in pursuit of a sixth Madrid Open title after beginning the claycourt season by winning an 11th Monte Carlo Masters and lifting the Barcelona Open trophy for the 11th time.
World number six Juan Martin del Potro crashed out of the tournament after Serbia’s Dusan Lajovic came back from a set down to beat the Argentine 3-6 6-4 7-6(6) in the third round.
Del Potro looked in complete control as he converted two break-point opportunities to take the opening set but Lajovic, ranked 95th in the world, dug deep to stay in the contest.
A break midway through the second set was enough for Lajovic to force a decider before he wrapped up his first career victory over a top-10 opponent in the tiebreak.
In the quarter-finals, Lajovic will meet South Africa’s Kevin Anderson who overcame German Philipp Kohlschreiber 6-3 7-6(7).
Britain’s Kyle Edmund followed up his surprise win over Novak Djokovic by defeating world number 10 David Goffin to reach the last eight of an ATP Masters 1000 event for the first time in his career.
The 23-year-old broke his Belgian opponent’s serve twice in the opening set and once in the second, to seal a 6-3 6-3 victory in an hour and 12 minutes.
Edmund will next face Canadian teenager Denis Shapovalov, who achieved a 6-4 6-4 win over compatriot Milos Raonic.