With bomb-proof tunnels, anti-tank weapons hidden in mosques, human shields and a "mastery" of the terrain, militants holed up in a southern Philippine city are proving a far tougher opponent than military chiefs expected.
Two weeks after gunmen waving black flags of the Daesh group rampaged through the Muslim city of Marawi, initial assertions from authorities that the conflict would be over in days have given way to warnings of a protracted battle.
"The advantage of the [enemy] is their mastery of the terrain. They know where even the smallest alleys lead to and they are free to go around," Major Rowan Rimas, an operations officer for the marines, told reporters in Marawi this week.
"They know where the government forces are coming from and where they are taking cover. They have snipers and their positions are well-defended."
Defence Secretary Delfin Lorenzana admitted at the start of the conflict that security forces were taken by surprise when dozens of gunmen appeared on the streets of Marawi following a failed raid to capture one of their leaders.
Authorities said two brothers from Marawi surnamed Maute were key leaders in the battle, giving the militants a crucial home-ground advantage that has allowed them to withstand a relentless air campaign of bombs and rocket strikes.
The roughly 10 percent of Marawi held by the militants has many tunnels and basements that can withstand 500-pound (227-kilo) bombs, military spokesman Lieutenant-Colonel Jo-ar Herrera told AFP on Monday.
Herrera said Philippine military protocol called for mosques and Islamic schools known as madrassahs to be spared from air strikes and artillery, a limitation exploited by the gunmen. Residents built reinforced bunkers and tunnels underneath their houses after a 1970 Muslim uprising led to large parts of the city being burnt, Norodin Alonto Lucman, a senior Marawi politician, told AFP.
Adding to concerns that the militants were running a far more complex and extensive operation than authorities initially believed was the discovery on Monday in a house the gunmen had been using of 52.2 million pesos ($1.05 million) in cash.
The gunmen have the added insurance of about 2,000 trapped civilians serving as virtual human shields, along with the priest and more than a dozen civilians kidnapped at the start of the crisis.
President Rodrigo Duterte imposed martial law across the entire southern region of Mindanao, home to 20 million people, within hours of the crisis erupting in a bid to quickly crush what he said was the fast-rising threat from IS. He set a target late last week of Tuesday to clear the city of the militants. As that deadline passed, Duterte issued typically aggressive rhetoric to soldiers. "I am ordering you to crush our enemy," he said in a speech to troops in the south, "When I say crush them, you have to destroy everything, including lives." But a quick military victory looks increasingly unlikely.