The Philippine Congress on Saturday voted to extend President Rodrigo Duterte's declaration of martial law in the south until the end of the year to defeat Daesh-linked militants.
In a special joint session of the House and the Senate, legislators overwhelmingly backed Duterte's bid to have martial law remain in force in the Mindanao region until December 31.
The vote came as troops continued their two-month long fight to wrest back the southern city of Marawi from Daesh-inspired militants.
Duterte's spokesman Ernesto Abella thanked Congress for its vote, saying "the nation has chosen to stand united in defending the Republic".
"The extension of martial law is essential to the overall peace and stability," he said in a statement.
Although opposition legislators questioned government officials for hours on the legality of the move, the vote was largely a foregone conclusion as Duterte enjoys majorities in both houses of Congress.
"We may wake up one day and martial law will be in force in the whole country," Senator Franklin Drilon said after the vote.
A slide presentation accompanying Duterte's request, seen by AFP, compared the Marawi crisis to the Daesh takeover of the Iraqi city of Mosul.
Marawi itself could now become a magnet for foreign fighters in Iraq and Syria, it said.
Most of the militants' leaders remain at large, the presentation added, while about 90 of the gunmen have slipped past security cordons and can link up with other armed groups in the region to mount similar widescale attacks.
At the hearing, defence and security officials justified the extended martial law, saying that aside from Marawi, militants were planning attacks in other parts of Mindanao.
In Marawi, the military said only about 60 gunmen were left in a 49-hectare (121-acre) area of Marawi, but Duterte said he needed martial law powers to rebuild the city and ensure the war did not spread elsewhere.
"I cannot afford to be complacent," Duterte told reporters Friday, adding the military would be conducting further "mopping up operations" even after they recapture Marawi.
"If there is a spillage it will not be as bad if you have this stopgap," he added.
Duterte imposed 60-day martial rule – the maximum period allowed by the constitution – over the Mindanao region on May 23 within hours of the gunmen beginning their rampage.
On Monday he asked Congress to extend it until the end of the year, along with the continued suspension of a constitutional safeguard against warrantless arrests.
Martial law allows the military to establish control with measures such as curfews, checkpoints and gun controls in a country where civilians are authorised to keep licensed firearms in their homes.
However, any martial law extension must be approved by Congress.
The subject remains sensitive in the Philippines, decades after the late dictator Ferdinand Marcos put the country under military rule for part of his 20-year term.
Thousands of critics, political opponents as well as communist guerrillas were killed, detained or arrested during the period, according to historians.
About a dozen protesters in the gallery interrupted Saturday's hearing, chanting "never again, never again to martial law" before being escorted out.
In Marawi, the area's military spokesman Lieutenant Colonel Jo-ar Herrera assured the public that martial law would not be abused.
"Don't be afraid. Your soldiers are professionals. All our actions are based on the rule of law. We will respect the rights of our countrymen," he said.
Herrera said five soldiers had been killed in fighting on Saturday alone, bringing the total of slain troops to 105 with 428 militants killed.
Duterte had already beaten back a Supreme Court petition to declare martial law in Mindanao illegal.
"Once he feels that there is not enough opposition to a nationwide martial law declaration, he will go for it," in a bid to stay in office after his six-year term ends, Senator Antonio Trillanes said on Tuesday.
Duterte, 72, insists he has no plan to stay in office beyond his term.