IT DID not take long for Islamic State (IS) to claim responsibility for a bomb on the island of Basilan, part of the southern region of Mindanao in the Philippines, that killed nine soldiers and civilian bystanders, along with the driver of the van. The army suspects the work of Abu Sayyaf, a brutal kidnapping-for-ransom gang from Basilan and the neighbouring island of Jolo which these days claims allegiance to IS. The attack, on July 31st, highlighted the dangers of dragging out a slow, stumbling peace process that had made a leap forward just days before, when President Rodrigo Duterte enacted the Bangsamoro Organic Law. The law is key to ending half a century of rebellion by Filipino Muslim separatists in Mindanao which has cost tens of thousands of lives. It is surely key, too, to ending the chaos in which jihadists such as IS thrive.

Congress had taken years to pass the new law, which provides for greater autonomy for the homeland of the Bangsamoro, Muslims who are in a majority in their part of Mindanao (which is predominantly Christian, like the country). In return, the main rebel group, the Moro Islamic Liberation Front (MILF), has dropped its demand for Bangsamoro independence. Greater autonomy was promised in a peace agreement signed by the government with the MILF in 2014.

The armed campaign for Bangsamoro independence began in 1969. The 2014 agreement was the culmination of decades of on-and-off negotiations between the government and Muslim separatist rebels, first the Moro National Liberation Front and then its less secular offshoot, the MILF. During those years, war-torn, impoverished Mindanao spawned a plethora of armed groups: some Muslim separatists, some communists, some simply violent criminals. Jihadists took advantage of the general lawlessness to recruit fighters to their cause.

After the peace agreement was signed, Congress shied away from the legislation it entailed when current and former MILF fighters killed 44 paramilitary policemen operating against jihadists. When Mr Duterte, whose power base is in Mindanao, became president in 2016, he said he was determined to complete the peace process. But Congress was still slow to pass the legislation, fearful lest it turn out to contravene the constitution. In 2008 the Supreme Court had declared a previous peace agreement unconstitutional, so infuriating one faction of the MILF that it broke away. The splinter group, the Bangsamoro Islamic Freedom Fighters (BIFF), later pledged allegiance to Islamic State.

The Bangsamoro Organic Law may yet be challenged in court. That is one of the reasons Mr Duterte has called for the constitution to be rewritten to turn the Philippines from a unitary state to a federation.

A bloody attempt last year by groups including Filipino adherents of IS to capture and hold the city of Marawi was crushed when the army laid siege for months, destroying the city to save it. Yet BIFF guerrillas and Abu Sayyaf terrorists remain active in the south, as the bombing in Basilan showed. Not just the government but also the MILF chairman, Al-Hajj Murad Ebrahim, believe peace and economic development in Mindanao will defeat the jihadists by drying up their sources of recruits. The battle for Marawi, and now this latest bombing, are warnings that jihadists are lurking, ready to pounce unless Mr Murad and Mr Duterte make haste to end the separatist conflict.

Correction (July 31st 2018): A previous version of this article misstated the number of people who died in the truck bombing. This has now been updated.