Brigadier General Restituto Padilla said the militants have withdrawn and “the school area is again safe”.

The military is still investigating whether five civilians are still being held captive, according to Reuters. None of the hostages are thought to be children.

Pigcawayan is on Mindanao island, the same island where fighting between government troops and Islamists has been running for five weeks, according to a Reuters report.

Pigcawayan is 190km south of Marawi City where militants have also taken control, leaving up to 1000 civilians trapped and forced to work as orderlies and cooks, according to the AFP.

A map showing Marawi City in the north and the town of Pigcawayan in the centre of Mindanao Island.

On Tuesday, the Philippine military bombed rebel positions and ground troops launched a renewed push against the militants holed up in Marawi City, as it aims end the fighting before the weekend Eid festival.

Local authorities are concerned that after Ramandan the fighting could further intensify.

“We are closely watching certain groups and we hope they will not join the fight,” military spokesman Brigadier-General Restituto Padilla previously told Reuters.

Devout Muslims are forbidden to fight during Ramadan.

The death toll linked to the civil unrest, which began on May 23, stands at more than 300.

The momentum of the militants in the Philippines has raised concerns among neighbouring countries in Southeast Asia fearing it could become an Islamic State stronghold for the region.