Philippine President Rodrigo Duterte has imposed martial law on the southern region of Mindanao to combat militants who have declared allegiance to the Islamic State group.
Here is what we know about his reasons and what happens next:
– What happened to trigger martial law? –
Duterte acted after security forces on Tuesday battled dozens of gunmen in Marawi, a city of about 200,000 people. One policeman and two soldiers died in the fighting, authorities said.
Tuesday's violence was the latest in a series of deadly clashes with militants who have pledged allegiance to the Islamic State (IS) group and are based throughout Mindanao.
Duterte's declaration fulfilled an often-repeated promise to impose martial law to combat the IS-linked militants, whom he has said are a growing threat to national security.
But he has said repeatedly that martial law may be needed to solve many other problems, including illegal drugs.
– Who are the militants? –
Authorities said they were battling members of two of the best-known groups to have declared allegiance to IS, the Abu Sayyaf and Maute organisations.
The military said it was hunting Isnilon Hapilon, an Abu Sayyaf leader who has been named the Philippine head of IS. The US government is offering a $5-million bounty for his capture.
The Abu Sayyaf is infamous for kidnapping foreigners and killing them if ransoms are not paid. It is also blamed for the nation's worst terror attacks, including the 2004 bombing of a ferry in Manila Bay that claimed more than 100 lives.
– Is martial law necessary? –
Duterte has said repeatedly the growing influence of Islamic State was one of the nation's top security concerns, and martial law was necessary to stop it.
However, Islamist militancy is not new to the southernPhilippines, where a decades-long Muslim separatist insurgency claimed more than 120,000 lives.
Muslim rebels orchestrated a siege in the southern city of Zamboanga in 2013 that left more than 200 people dead, but the government of then-president Benigno Aquino did not declare martial law.
Aquino also said he had considered imposing martial law just before standing down last year in Sulu, island strongholds of the Abu Sayyaf in the far south of Mindanao.
But Aquino said he decided against it partly because military rule could spark resentment among local people.
– What will happen under martial law? –
Martial law allows the president to "call out the armed forces to prevent or suppress lawless violence, invasion or rebellion", according to the constitution.
Duterte said Wednesday he would be "harsh" and his version of martial law would include warrantless arrests and searches, along with curfews in some provinces.
Critics fear it will give security forces cover to carry out human rights abuses, citing the experience under dictator Ferdinand Marcos a generation ago.
During the nine years of martial law under Marcos, police and troops tortured, abducted and killed thousands of people who were critical of the dictatorship, according to rights groups and historians.
"Martial law of Mr Marcos was very good," Duterte said, adding military rule in Mindanao would be similar to that under the dictator.
– What happens next? –
The constitution limits martial law to 60 days unless congress agrees to extend it.
The post-Marcos constitution also imposed safeguards on martial law, including the requirement for congress to approve its imposition and extension. The Supreme Court can also rule on its legality.
But Duterte had previously said he was prepare to ignore the constitutional safeguards.
He said Wednesday martial law would remain until there was no more terrorist threat, and that he was prepared to expand it nationwide.
"I will not hesitate to do anything and everything to protect and preserve the Filipino nation," he said.
"If it means many people dying, so be it."