The Philippines military said Islamist militants who had holed up in a primary school in the south early on Wednesday with some civilians had retreated after a gunbattle with troops, and there were no casualties.
No students were taken hostage at the school in Pigcawayan town in North Cotabato province on Mindanao island, said Brigadier General Restituto Padilla, discounting earlier reports that some children were being held.
However, he said the military was investigating whether around five civilians were still with the militants.
"It's already resolved," Padilla told a regular briefing. "They've withdrawn, they are no longer there. The school area is again safe. The troops are in pursuit mode."
Witnesses about a kilometre from the school said they could hear gunfire. Troops were preventing anyone from getting closer.
A police report said about 300 armed men, among them members of the Bangsamoro Islamic Freedom Fighters (BIFF), stormed the school early on Wednesday. On another part of Mindanao, fighting between government troops and pro-Islamic State militants for control of Marawi City has entered its fifth week.
Pigcawayan is 190 km (120 miles) south of Marawi City.
Abu Misry Mama, a spokesman for the BIFF, told Reuters that the militants had taken civilians to a place safe from the crossfire, and did not intend to hold them hostage.
Asked if they would be freed, Mama said: "Yes. We're not kidnappers."
Padilla said the incident at Pigcawayan was not related to the fighting in Marawi. "This has come from a group that has long committed harassments," he said.