Early on Wednesday, Chief Inspector Realan Mamon said the militants had entered the school in the town of Pigcawayan and taken a number of students hostage.
According to a police report, some 300 armed men, among them members of at least one group affiliated to Daesh, had entered the school.
Military forces were deployed and engaged in a gun battle with the militants.
Later, a military spokesman, Restituto Padilla, said the gunmen had “withdrawn” and that the hostage taking was over with no casualties.
“It’s already resolved,” he told reporters. “They’ve withdrawn; they are no longer there.”
Padilla, however, said an investigation was underway to determine whether five civilians had been taken away by the militants.
A spokesman for a militant group involved in the attack said earlier that they had taken civilians to a safe place after they engaged in a gun battle with the troops. He claimed that they did not intend to hold the civilians hostage, however.
Pigcawayan is located in the North Cotabato Province and is located some 120 kilometers south of Marawi City, where terrorist groups allied to Daesh have been engaged in clashes with the Philippines' military for over a month, Presstv reported.
Pigcawayan Mayor Eliseo Garcesa said officials were still seeking information whether any casualties had occurred.
The developments come a day after the Philippine military intensified its offensive against the militants in Marawi City.
“We are aiming to clear Marawi by the end of Ramadan,” said military spokesman Brigadier-General Restituto Padilla, explaining, however, that that was not a strict deadline.
Philippine troops are fighting for a fifth week to dislodge at least 200 militants holed up in Marawi since last month. As of Tuesday, some 258 militants, 65 security forces and 26 civilians had been killed in the city, according to the military.
An estimated 500 to 1,000 civilians are trapped in the city, some of them being used as human shields.