MANILA, Philippines — The Philippine president on Friday signed a widely opposed anti-terror law which critics fear could be used against human rights defenders and to muzzle dissent.

President Rodrigo Duterte signed the Anti-Terrorism Act after weighing the concerns of different groups, demonstrating the government’s commitment to stamping out terrorism, presidential spokesman Harry Roque said.

Opponents say they will question the constitutionality of the law in the Supreme Court.

The law, which Congress sent to the president for signing last month, allows the detention of suspects for up to 24 days without charge and empowers a government anti-terrorism council to designate suspects or groups as suspected terrorists who could then be subject to arrest and surveillance.

Military officials have cited the threat of terrorism, including from Islamic State group-linked Abu Sayyaf militants in the southern Philippines, as a reason why the country needs the law. It replaces a 2007 anti-terror law called the Human Security Act that has been rarely used, largely because law enforcers can be fined 500,000 pesos ($9,800) for each day they wrongfully detain a terrorism suspect.

Lawmakers removed such safeguards in the new legislation, which increases the number of days that suspects can be detained without warrants from three to 24.

Opposition to the law has been mounting, with Catholic bishops saying the definition of terrorism under the law is so broad it could threaten legitimate dissent and civil liberties. The Integrated Bar of the Philippines, the largest group of lawyers in the country, and U.N. rights officials have also expressed concern along with nationalist groups and media watchdogs.

Opponents said the law violates the constitution, which restricts detention beyond three days without specific charges.

“This administration has effectively crafted a new weapon to brand and hound any perceived enemies of the state,” said Nicholas Bequelin, Amnesty International’s Asia-Pacific regional director. “In the prevailing climate of impunity, a law so vague on the definition of ‘terrorism’ can only worsen attacks against human rights defenders.”

“Under Duterte’s presidency, even the mildest government critics can be labeled terrorists,” Bequelin said.

Defense Secretary Delfin Lorenzana and other security officials have played down fears the law could be misused, saying it won’t be used against government opponents.

The legislation states that terrorism excludes “advocacy, protest, dissent, stoppage of work, industrial or mass action and other similar exercises of civil and political rights.”

For years, government troops have been battling Abu Sayyaf militants who have been listed as terrorists by both the United States and the Philippines for ransom kidnappings, beheadings and bombings in the restive south.

In 2017, hundreds of militants affiliated with the Islamic State group laid siege to Marawi city in the south. Troops quelled the siege after five months in a massive offensive backed by the United States and Australia that left more than 1,000 people dead, mostly militants, and the mosque-studded city in ruins.