JAKARTA (Reuters) - Indonesia’s parliament approved on Friday tougher anti-terrorism laws as it seeks to combat a surge in homegrown Islamist militancy, days after suicide bombings claimed by Islamic State killed more than 30 people in the city of Surabaya.

A view of Indonesia's Parliament building in Jakarta, Indonesia, November 23, 2017. REUTERS/Beawiharta/File Photo

Revising a 2003 law became a top priority for the world’s biggest Muslim-majority country after the Surabaya attacks, the deadliest in Indonesia in nearly two decades.

The revised law allows police to preemptively detain suspects for longer and prosecute those who join or recruit for militant groups.

It also seeks to determine the sensitive issue of the military’s role in anti-terrorism operations.

“The president hopes that with the passage of this bill, we can be successful in eradicating terrorism using both soft power and hard power,” Johan Budi, a spokesman for President Joko Widodo, said in a text message.

Indonesia’s most deadly Islamist militant attack took place on the tourist island of Bali in 2002, when bombers killed 202 people, most of them foreign tourists.

In subsequent years, Indonesia scored some major successes in tackling militancy.

But recently there has been a resurgence of militant violence and scores of Indonesians have traveled to the Middle East to fight for Islamic State.

Thousands are believed to be drawing inspiration from the group at home.

Law enforcement agencies have complained that they lack the power to detain militants suspected of plotting attacks unless a threat is made or an attack actually carried out.

Under the revised law, anyone suspected of planning an attack can be held for up to 21 days for an initial examination, instead of a week, and for up to 200 days for a formal investigation.

Suspects will also be open to prosecution for joining a “terrorist” organization, disseminating such teachings or taking part in military-style training at home or overseas.

Those convicted of smuggling explosives or other chemicals and weapons into or out of the country for “terrorism” will face a maximum penalty of death.

NO SILVER BULLET

The revised bill was proposed by Widodo’s government in early 2016, after a gun and suicide-bomb attack in Jakarta, which at the time was the first Islamic State-linked attack in Southeast Asia.

But the proposed changes languished in parliament amid concern over infringement of rights and after some parties objected to clauses that could mean greater military involvement in internal security.

The new bill states that overcoming terrorism is part of the military’s operations outside of war, but it can only get involved upon a request from the police and with presidential approval.

Separately, Widodo’s government has proposed setting up a special military task force to boost the efforts of the elite counter-terrorism police squad, Detachment, or “Densus”, 88.

There have long been concerns that rivalry between the police and the military could complicate the fight against militants.

“They will only be allowed to get involved in the operational phase, where the police feel they need more resources,” Atmadji Sumarkidjo, a senior government official, said of the military.

The bombings in Surabaya, in which two families, including children as young as eight, carried out suicide attacks on churches and a police station, added a sense of urgency to the legislation.

Andreas Harsono of Human Rights Watch welcomed the central role of the national anti-terrorism agency in the new bill, though said more needed to be done to monitor radicalized people returning from the Middle East.

“The law itself isn’t a silver bullet. It’s time for a sober assessment of why most deradicalization programs have not worked,” he said.

The legislation will still also not be as tough as some other countries in the region.

Malaysia in 2015 reintroduced a law under which suspects can be detained without trial for up to two years with two-year extensions thereafter.