The US Open champion was beaten 7-6 (7-1) 5-7 6-7 (6-8) 7-6 (7-5) 6-2 after five hours and eight minutes of exhausting tennis on Court Philippe-Chatrier.
Thiem has struggled with injury concerns and a more general physical weariness in Paris but produced a remarkable level of resistance against the inspired Schwartzman, who has reached his first grand slam semi-final.
French Open 2020: Thiem stunned in five-hour epic as Schwartzman reaches semi-finals
However, after the Argentine snatched the fourth set during a fiercely fought tie-break, he assumed control of the decider to record perhaps the biggest win of his career.
Thiem accepted he was physically unable to compete in the fifth set but could not complain about the result or his performance level at Roland Garros.
“To be honest, I was over the limit today,” he said. “But if I would have won, I mean, Diego in that case, he has two days off now. Maybe I would have recovered [for the semi-finals]. Even though I’m physically and mentally on the edge, you never know in a slam.
“But, well, at the end I gave everything I had out there. It was an amazing match. I think [it was] the first in my career over five hours. Diego fully deserves it.
“I was doing quite well. Also today, I still could play at quite a high level for more than five hours. But, I mean, he was keeping it up until the end. He was probably a little bit fresher than me in the fifth set, so that’s why he won.
“In general, I mean, I’m not sad with my performance here in Roland Garros. I mean, it was pretty short time with the long trip home, jet lag, and everything. Then, of course, the first slam, which is a special thing. Come here, play in pretty brutal conditions, I would say. I cannot say it was a bad tournament, I’m pretty happy about it.”
Schwartzman had three set points on serve in the fourth but Thiem was able to force the breaker thanks in part to an astonishing running forehand winner.
Once his opponent and good friend had levelled the contest, however, he felt the match was out of his hands.
“I came back unbelievable in the fourth set,” he said. “When he served for it at 5-4, 40-Love, I played this down-the-line winner. The match was basically all the time on the edge for both of us. Tiebreak at 5-5 he played a great point. With that in the bag, I think he had a little advantage in the fifth set.
“I think if I would have wanted to win that match, I should have done it in four. In the fifth set, he was just a little bit more fresh and better than me.
“I’m super disappointed that I lost, that I didn’t make the semis this year. But at the same time I’m happy for him. He really deserves it. It’s an amazing achievement by him to break into the top 10 for the first time in the career.
“Maybe to lose against a friend hurts a little bit less, yeah.”
Speaking on court after his win, Schwartzman said: “Dominic is one of the best players right now in the world. We are friends. I have a lot of respect for him and that’s why this match is very, very important for me.
“This is the third time I’ve played five sets here and I think at the end of this night I deserve to win.
“In the second set and third set I was out of my mind. I was crazy, screaming, talking to my coach. My coach was saying ‘play tennis, nothing else’.
“I was so nervous because I saw a chance today and didn’t take it in the second or the third. But I’m very happy.”
Get breaking news alerts.
You have already subscribed