MANILA — President Rodrigo Duterte said he is ready to withdraw government troops in Marawi City if the Supreme Court decides there is no factual basis for his declaration of martial law in Mindanao.

"I will withdraw and, if anything goes wrong, mag-declare ulit ako ng martial law the second time around," Duterte, in his first public appearance in 5 days, told reporters in Butuan City on Saturday.

But the president explained that if violence in Mindanao and other parts of the country escalates again, he would declare martial law without consulting anybody.

"If that rebellion burns Mindanao and the other parts of the Philippines then I’ll be forced to declare martial law again, this time I would do it on my own to preserve my nation. I will not consult anybody and there is no telling when it would end," he said.

He even warned that it could be similar to the martial law declaration of former President Ferdinand Marcos.

"It could be a copycat of Marcos, wala akong magawa," he said.

Duterte placed Mindanao under military rule on May 23 due to clashes between state forces and Islamic State-linked terrorists.

In justifying his declaration, Duterte told Congress in a report that the extremists were planning to create an Islamic State province Mindanao.

Article 7, Section 1 of the Constitution states that the president may declare martial law in case of invasion or rebellion.

Duterte defended his martial law declaration, explaining that the Maute group and the Abu Sayyaf group in Mindanao were committing rebellion.

"They committed the crime of rebellion and there is the flag of ISIS. If that is not enough what is it?" he said.

"The terrorists are committing rebellion, the rebels are committing rebellion. Ano ba tingin mo? What do you want? That they burn half of Mindanao before we call it a true-blue rebellion? It’s crazy," he added.