(independent) -- The pro-ISIS militants, among them members of the Bangsamoro Islamic Freedom Fighters (BIFF), stormed the school in Pigcawayan town in North Cotabato province on Mindanao island.
They took five civilians as shields during their retreat, the military said.
There were no casualties and no students were taken hostage, Brigadier General Restituto Padilla said, discounting earlier reports some children were being held by the fighters.
However, he said the military was investigating whether the five civilians were still with the militants.
Philippine troops, backed by airstrikes and artillery, remain involved in the offensive to wrest back control of villages and the business district.
The US military in recent weeks deployed a P3 Orion aircraft to provide surveillance and intelligence to troops battling more than 100 gunmen holding an unspecified number of hostages in four remaining Marawi villages. Pigcawayan is 190 km (120 miles) south of Marawi City.