Djokovic, chasing the only grand slam title to elude him, was in complete control until the end of the third set, when the big-serving Cilic forced him to a tiebreak, which the six-times grand slam champion lost 7-2.
Normal service resumed afterwards and Djokovic, although not playing his best tennis, finished it off on Cilic's serve when the Croatian double faulted.
"Physically I had to work very hard, because he was very aggressive, and I could expect that," said Djokovic.
"In important moments I held my nerve and, you know, I'm very happy that I went through."
His next opponent will be local favourite Jo-Wilfried Tsonga, the 13th seed, who defeated Polish 22nd seed Jerzy Janowicz 6-4 6-4 6-3.
There was no joy for the other Frenchman on course as Gilles Simon, the 29th seed, lost 4-6 6-3 2-6 6-2 7-5 to eighth seed Milos Raonic, who became the first Canadian man to reach the round of 16 at Roland Garros.
Round 3 matches
13-Jo-Wilfried Tsonga (France) beat 22-Jerzy Janowicz (Poland) 6-4 6-4 6-3
10-John Isner (U.S.) beat 17-Tommy Robredo (Spain) 7-6(13) 7-6(3) 6-7(5) 7-5
6-Tomas Berdych (Czech Republic) beat 27-Roberto Bautista (Spain) 6-1 6-2 6-7(4) 6-4
2-Novak Djokovic (Serbia) beat 25-Marin Cilic (Croatia) 6-3 6-2 6-7(2) 6-4
4-Roger Federer (Switzerland) beat 31-Dmitry Tursunov (Russia) 7-5 6-7(7) 6-2 6-4
18-Ernests Gulbis (Latvia) beat Radek Stepanek (Czech Republic) 6-3 6-2 7-5
- Sports & Recreation
- Jo-Wilfried Tsonga