Police say soldiers engaged in gun battle with fighters who stormed a school near Pigcawayan town on Mindanao island.

The Philippine military says gunmen who had holed up in a primary school on the southern Midanao island have retreated after a gun battle with troops but are holding some civilians hostage.

Suspected members of the Bangsamoro Islamic Freedom Fighters (BIFF) group were engaged in a gun battle with security forces at Malagakit, close to Pigcawayan town, Chief Inspector Realan Mamon said in a radio interview on Wednesday.

Brigadier General Restituto Padilla, army spokesman, said five civilians were taken hostage, none of them students, as human shields.

The Malagakit school is believed to had been closed at the time of the attack.

Eliseo Garcesa, mayor of Pigcawayan, told Philippine radio that about 200 gunmen were involved in the attack. He said he was still seeking information about possible casualties.

READ MORE: Army renews push against ISIL-linked group in Marawi

Pigcawayan is in North Cotabato province in the centre of Mindanao island.

President Rodrigo Duterte last month declared a state of emergency on the southern island after fighters linked to the Islamic State of Iraq and the Levant (ISIL, also known as ISIS) group laid siege on Marawi City, some 190km north of Pigcawayan.

Fighting between the army and ISIL-linked groups, including BIFF fighters, in Marawi has entered its fifth week.

“Although the situation in Pigcawayan may not be directly linked to the fighting that has been raging in Marawi for the past few weeks, it may have something to do with the martial law that been imposed across the region,” Al Jazeera’s Jamela Alindogan, reporting from Mindanao, said.

Padilla said it was possible the attack was intended to disrupt the ongoing military offensive in Marawi.

“If this is a diversionary move, it’s not the first by these BIFF gunmen,” Padilla said. “They have tried to attack more than once and all have been thwarted.”