You are not permitted to download, save or email this image. Visit image gallery to purchase the image.
He won 7-6(1) 5-7 6-7(6) 7-6(5) 6-2 and reach his first French Open semifinal today.
Schwartzman had never beaten a top-five player at a Grand Slam and had lost his three previous quarterfinals but he produced a relentless display to set that record straight.
Both players appeared to be running on empty at times as they slugged out endless rallies from the baseline for more than five hours on a windy Court Phillipe Chatrier.
Third seed Thiem, the US Open champion, saved a set point in the third before moving two sets to one ahead and when Schwartzman wasted three set points at 5-4 in the fourth it looked as though he was going to fall short.
But the 12th seed showed incredible resilience to come back from 3-1 down in the tiebreak to drag it into a final set.
Schwartzman looked the fresher player in the decider and Thiem, bidding to reach a fifth successive French Open semifinal, began to unravel.
The Argentine sensed his moment and forged a break ahead before claiming victory as Thiem dumped a weary-looking drop shot into the net on match point.
Schwartzman will face either 12-time champion Rafael Nadal, who he beat in the recent Rome tournament, or Italian teenager Jannick Sinner in the last four.
Second seed Nadal's clash with Sinner was still to be played after a women's quarterfinal on Tuesday.