Murray held off an offensive assault from the 29th-seeded del Potro of Argentina 7-6 (8), 7-5, 6-0 at Court Philippe Chatrier in a tense clay-court match that lasted two hours and 53 minutes.
The Scott secured his place in the Round of 16 with the win in a rematch of the 2016 Rio Olympics gold-medal final won by Murray.
Murray withstood a barrage of baseline blows to save set points at 5-3 and with del Potro serving for the opener at 5-4.
"Yeah, I expected a very tough match," Murray said afterward. "And the first set was very, very important, I think, for the rest of the match. Whoever had won that first set had big momentum. In these conditions, when it's slow and heavy, to be coming back is difficult."
Del Potro, playing in his first French Open since 2012 because of a series of operations on his left wrist, had four set points in the opening set but lost each one, including a double-fault while ahead 7-6 in the tiebreaker.
"I couldn't believe that set, that I lost that set, because I had many opportunities to win," said del Potro, the 2009 U.S. Open champion. "I have been playing great points during the whole first set. But this happens when you play against the No. 1 in the world or a great champion as Andy, you never know when you can win a set or a match."
Murray spoiled del Potro's 100th Grand Slam match, firing 44 winners and converting six of 17 break chances.
Murray, last year's runner-up at Roland Garros and a three-time Grand Slam title winner, is into the fourth round for the eighth time in 10 appearances in Paris. He avoided a third consecutive four-set match to open the tournament.
"It was definitely (my best match) during the clay-court season," Murray said. "I played some good matches at the beginning of the year, but definitely in the clay-court season, the second and third sets were the best I have played.
"It was obviously an important win for me and a big match, because Juan, when he's playing well, is one of the best players in the world. To be playing him this early on in a slam is not easy, but it can be a very positive thing. When you play someone that good, maybe you're a little bit more switched on and your focus is maybe a little bit higher."
"My return was working extremely well today," said Cilic, who had eight aces.
Cilic, the 2014 U.S. Open champion, will next face South African Kevin Anderson, who beat Britain's Kyle Edmund 6-7 (6), 7-6 (4), 5-7, 6-1, 6-4.