Philippine President Rodrigo Duterte has said martial law on Mindanao island could last a year, while the army fights against Islamist militants.
The violence on the southern island has left three members of the security forces dead, officials say.
Mr Duterte earlier declared martial law for 60 days on Mindanao, where Muslim rebel groups are seeking autonomy.
Some of the groups, such as the Maute, have pledged allegiance to so-called Islamic State (IS).
After announcing martial law on Tuesday, President Duterte, a Mindanao native, warned that he would be harsh in dealing with terrorism.
“If it would take a year to do it, then we’ll do it. If it’s over within a month, then I would be happy,” he said in a video posted online by the government.
Mr Duterte had to cut short his visit to Russia to deal with the violence.
During his talks in Moscow with Russian President Vladimir Putin, he also said the Philippines needed more modern weapons to fight IS militants and other militant groups.
Martial law allows the use of the military to enforce order and the detention of people without charge for long periods.
The Philippine constitution says a president can only declare martial law for 60 days to stop an invasion or a rebellion.
Parliament can revoke the measure within 48 hours while the Supreme Court can review its legality.
This is only the second time martial law has been declared since the fall in 1986 of President Ferdinand Marcos.
Deep-rooted conflict
The violence in Marawi, a city of about 200,000 people in Mindanao, erupted on Tuesday as the army searched for the leader of a militant group that had pledged allegiance to IS, the military said.
Defence Secretary Delfin Lorenzana identified the militants as members of the Maute group. They had occupied a hospital and a jail, and burnt down buildings including a church, he added.
Marawi is about 800km (500 miles) south of the capital Manila.
Mr Duterte had promised that finding a lasting peace on the island would be a top priority on his administration.
But the conflict is complex and deep-rooted, the BBC’s Jonathan Head reports.
Solutions have eluded previous governments, and it is not clear that President Duterte’s reliance on martial law will prove any more successful, our correspondent says.
Join GhanaStar.com to receive daily email alerts of breaking news in Ghana. GhanaStar.com is your source for all Ghana News. Get the latest Ghana news, breaking news, sports, politics, entertainment and more about Ghana, Africa and beyond.