It was the first set Nadal had lost in his last 38, stretching over three French Open campaigns - meaning Bjorn Borg's record of 41 straight sets won remained intact.
The victor of the match will play either third seed Marin Cilic or Schwartzman's compatriot Juan Martin del Potro. Schwartzman saw two set points come and go but at the third time of asking, after a delay while a spectator was helped out after feeling ill, the Argentine ripped a forehand victor.
A more serene start to the second set all changed when Nadal again dropped his serve at 1-1, and just as in the first while he recovered immediately, Schwartzman broke again for 3-2.
An off-balance Marterer could only net a forehand to gift the world number one a second break for 5-2 and the German fell two sets behind when a wild return flew well wide.
In new reversal, Trump says he didn't fire Comey over Russian Federation
Comey's handling of the conclusion of a separate investigation into whether Hillary Clinton mishandled classified emails. Trump's legal team has said that Mueller is working on a report addressing whether the president obstructed justice.
Jorginho 'agrees five-year Manchester City deal'
The ESPN FC panel assess the rumours linking Napoli's Jorginho and Leicester City's Riyad Mahrez with moves to Manchester City . And that could mean City's summer transfer business could be all but done before the World Cup even kicks off.
Donald Trump's meeting with Kim Kardashian at the White House
She arrived solo, and reportedly didn't need to be escorted by a publicist nor any close member of her inner circle. Will Kardashian have such luck? And, of course, Donald Trump couldn't wait to share a photo of their meeting.
But as in the first set, Nadal's riposte was swift, chasing down a drop-shot to set up a break-back opportunity, converted when Marterer thumped a forehand long.
World number one Simona Halep, the runner-up in 2014 and 2017, routed Belgian 16th seed Elise Mertens 6-2, 6-1 to reach the French Open quarterfinals for the third time.
The Spaniard, who won five straight games after a rain delay to beat Alexander Zverev in the Rome Masters final last month, managed three in a row this time before play was ended for the day.
Nadal, who turned 32 on Sunday, fired 39 winners as he completed the victory in two hours and 30 minutes to set up a match with Argentine Diego Schwartzman, who had earlier beaten Kevin Anderson.
Sharapova made 27 unforced errors, was broken six times and served six double faults in only her fifth loss from 25 Grand Slam quarter-finals.