MANILA (Reuters) - Philippine soldiers backed by armoured vehicles have retaken a southern town held for 12 hours by pro-Islamic State militants, the army said on Wednesday, with four rebels killed in urban clashes reminiscent of a five-month siege last year.

Slideshow ( 9 images )

The clashes followed warnings by President Rodrigo Duterte that remnants of pro-Islamic State militant groups had been recruiting and still planning attacks on several southern cities to set up an independent and separate Islamic state.

Troops pursued militants from the Bangsamoro Islamic Freedom Fighters (BIFF) group, who fled to the hills after trying to occupy a marshland town, Lieutenant-Colonel Harold Cabunoc, an army battalion commander, said in a statement.

The military will continue to “disrupt the BIFF’s plan to sow terror in communities” in the troubled south, Cabunoc said.

There was no immediate comment from the Islamist militants’ group.

Hundreds of residents have remained in shelter areas and not been allowed to return home after troops retrieved improvised explosive devices and other booby traps in the town of Datu Paglas.

Cabunoc said four Islamist militants were killed and two others were wounded. A soldier and a local militia official were also wounded.

The army said the Datu Paglas attack could be a test case, since the area was near the militants’ marshland base.

Since March, the military has shifted its combat operations from Marawi, a battered lakeside town in Mindanao embroiled in last year’s five-month conflict, to the island’s marshes where other pro-Islamic State militants operate.

More than 40 BIFF militants have been killed in the last four months by troops in air and ground assaults the military described as preemptive moves to thwart militant attacks on cities. [nL3N1RO2ZK]