The military intensified a bombing campaign on parts of Marawi on Mindanao island, one of the biggest Muslim cities in the mainly Catholic nation, as it accused the gunmen of atrocities including murdering women and a child.
The initial fighting prompted President Rodrigo Duterte to declare martial law on Tuesday across the southern third of the Philippines to quell what he said was a fast-growing threat from terrorists linked to the ISIS.
Most of the city's 200,000 residents have fled because of the fighting, but 2,000 remain trapped in areas controlled by the terrorists, according to Zia Alonto Adiong, spokesman for the provincial crisis management committee.
"They have been sending us text messages, calling our hotline, requesting us to send rescue teams but we cannot simply go to areas which are inaccessible to us," Adiong told AFP.
"They want to leave. They are afraid for their safety. Some are running out of food to eat. They fear they will be hit by bullets, by airstrikes," he said.
The military announced on Saturday, the start of the Muslim holy month of Ramadan, that it would step up the bombing.
"In as much as we would like to avoid collateral damage, these rebels are forcing the hand of government by hiding and holding out inside private homes, government buildings and other facilities," said military spokesman Brigadier-General Restituto Padilla.
"Their refusal to surrender is holding the city captive. Hence, it is now increasingly becoming necessary to use more surgical airstrikes to clear the city and to bring this rebellion to a quicker end."
The terrorists have killed at least 19 civilians, including three women and a child who were found dead near a university, regional military spokesman Lieutenant Colonel Jo-ar Herrera told AFP.
"These are civilians, women. These terrorists are anti-people," Herrera said.
An AFP photographer saw eight bodies dumped off a bridge on the outskirts of Marawi on Sunday, with local residents identifying them as employees of a rice mill and a medical college.
It was unclear whether those eight were included in the military's count of civilian deaths.
The violence began when dozens of gunmen went on a rampage throughout Marawi in response to an attempt by security forces to arrest Isnilon Hapilon, a veteran Filipino militant regarded as the local leader of ISIS.
The United States regards Hapilon as one of the world's most dangerous terrorists and has offered a bounty of $5 million for his capture.
The gunmen on Tuesday planted black ISIS flags, took a priest and up to 14 other people hostage from a church, and set fire to buildings. Authorities said Saturday the fate of those hostages remained unknown.
Duterte and military chiefs have said most of the militants belong to the local Maute group, which has declared allegiance to ISIS and which the government estimates has about 260 armed followers.
Duterte has said local criminals are also backing the Maute in Marawi.
Cooperation between Islamist terrorists, criminals and corrupt politicians is common across Mindanao, where a Muslim separatist rebellion has claimed more than 120,000 lives since the 1970s.
The main Muslim rebel groups have signed accords with the government aimed at forging a final peace, giving up their separatist ambitions in return for autonomy.
The Maute, Abu Sayyaf and other small hardline groups are not interested in negotiating and have in recent years looked to ISIS to help them.
Duterte said Saturday he was prepared to enforce martial law for as long as was necessary to end the terrorist threat, and even ignore constitutionally mandated safeguards such as Supreme Court and congressional oversight.