President Rodrigo Duterte has said martial law on Mindanao island could be extended across the Philippines, while the army fights Islamist militants.
Mr Duterte said insurgents had beheaded a policeman on the southern island. At least three other members of the security forces are reported dead.
On Tuesday he imposed martial law for 60 days on Mindanao, where Muslim rebel groups are seeking autonomy.
Some of the groups have pledged support for so-called Islamic State (IS).
Thousands of people have been fleeing fighting in the city of Marawi after gunmen rampaged through the city.
“I will not hesitate to do anything and everything to protect and preserve the Filipino nation,” the president said. “I might declare martial law throughout the country to protect the people.”
President Duterte, a Mindanao native, said the police chief of Malabang on Mindanao had been stopped on his way home “at a checkpoint manned by terrorists and I think they decapitated them right there and then”.
He warned on Tuesday that he would be harsh in dealing with terrorism.
“If it takes 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 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.
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 for his administration.
But the conflict is complex and deep-rooted.
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.