MANILA (Reuters) - Government troops have killed at least 11 members of a rebel group in the southern Philippines that has pledged allegiance to Islamic State, the military said, sending local communities fleeing as a battle raged on Sunday.

The Maute Group, one of a handful of small militant groups behind years of unrest in the south, had since Saturday occupied parts of a municipality in Lanao del Sur and were holed up in an abandoned town hall.

At least four soldiers were wounded in the clashes and there were unconfirmed reports that the group had raised the black Islamic State flag in the hall, said Marine Colonel Edgard Arevalo, a military spokesman.

“This was expected since they have long been professing allegiance to the foreign terror group,” he said.

“This is still part of the Maute Group’s agenda in courting support and encouraging similar-minded individuals to support ISIS (Islamic State),” he said.

The military has not given an estimate for the number of displaced but local media reported an exodus of as many as 16,000 people. Though the Philippines is predominantly Catholic, many people in the south are Muslim.

The government has blamed the Maute Group for a Sept. 2 bombing at a street market in the hometown of Philippine President Rodrigo Duterte, which killed 14 people and wounded dozens.

Several suspected group members were arrested a month later and, according to the defense minister, video clips were found of them pledging loyalty to the Islamic State cause.

Duterte has recently been warning about Islamic State taking root in the Philippines and said his country needed to avoid “contamination”..

“What we are afraid of is if the ISIS are forced out (of Iraq and Syria) and if (they) lose the land mass, they will try to come to Indonesia, Malaysia and the Philippines because they have declared the caliphate,” he said in a speech late on Saturday.