Indonesia passed a new law Friday that will give police more power to take pre-emptive action against terror suspects in the wake of the country's deadliest attacks in years.

The bill had been stalled for almost two years as parliament wrangled over details, including how to define terrorism, but a wave of deadly suicide bombings this month hiked pressure on lawmakers to pass the legislation.

Police will now be allowed to detain terror suspects for as long as 21 days, up from the current one week, and they will now also be able to charge people for joining or recruiting for a ‘terrorist’ organisation, at home or abroad.

Rights activists have expressed concerns that the bill's vague wording could open the door to a crackdown on any group seen as a threat.

This month, 13 people were killed in separate suicide attacks on churches and a police station by two families -- including a nine and 12-year-old girl -- in Indonesia's second-biggest city Surabaya.

The families had ties to a local extremist network that had pledged allegiance to the Islamic State group, which claimed the attacks.

A police officer was also killed in subsequent attack on a police station in Sumatra days later.

Indonesia -- which is set to host the Asian Games in three months and an IMF-World Bank meeting in Bali in October -- has long struggled with militancy.

Its worst-ever attack was the 2002 Bali bombings that killed more than 200 people, including locals and foreign tourists.

Security forces have arrested hundreds of militants during a sustained crackdown since the Bali bombing and most attacks in recent years have been limited to low-level operations against domestic security forces.

But police have said they needed beefed-up terror laws to crack down on homegrown militancy.

In the wake of the Surabaya attacks, President Joko Widodo threatened to issue an emergency regulation if the parliament failed to pass the new law.

Related Story