After an epic, back-and-forth match lasting five hours and eight minutes, Schwartzman savoured a 7-6 (7-1) 5-7 6-7 (6-8) 7-6 (7-5) 6-2 win - one of the most memorable victories in his career.
Schwartzman, a finalist in Rome last month, came into the match having not dropped a set in Paris, while US Open champion Thiem had been taken the distance by French youngster Hugo Gaston.
The Argentinian drew first blood but Thiem levelled the contest and then saved a set point in the third before moving 2-1 ahead.
An early break in the fourth appeared to have Thiem on course for victory but Schwartzman was able to force a dramatic decider.
The fifth was the most one-sided set of the match, Schwartzman breaking a run of holds with a crucial break of serve in the sixth game, and victory was his when a weary Thiem netted a drop shot.
Schwartzman will face 12-time champion Rafael Nadal or Jannik Sinner, who were scheduled to play later in the day.
A gruelling first set lasting over an hour was a sign of things to come.
An astonishing ninth game in the second set lasted almost 16 minutes as Thiem could not convert six break points, but he was finally able to strike in his next game returning serve and then held to take the set as Schwartzman found the net with a backhand.
The tension was palpable in an unbelievable third set that saw both players broken four times. Thiem led 5-1 and 6-4 in the breaker and could not convert his first two set points, before rallying to win two straight points and move in front, sealing it with a smash.
Another overhead saw Thiem break first in the fourth set but, just as it looked like the match had taken a decisive turn, Schwartzman struck straight back.
Schwartzman built leads of 4-2 and 5-3 but saw three set points go begging as he tried to serve it out at 5-4, Thiem sending a stunning forehand winner on the run down the line to make it 5-5.
Thiem, apparently desperate to avoid another five-setter, let rip with aggressive groundstrokes, but when the fourth set went the way of Schwartzman, the South American became favourite.
Breaking Thiem to love to lead 4-2 in that decider put Schwartzman in sight of the winning line, which he soon reached, the pair stopping to chat at the net at the end of the contest, each appreciative of the other's efforts in a remarkable battle.