Most of Marawi's 200,000 residents fled during the early stages of the fighting, with some taking refuge at evacuation centers in nearby towns. Noel Celis, AFP.

Camalia Baunto keeps a desperate vigil for news of her husband, trapped just a short walk away in brutal fighting between Islamist militants and government forces that has ruined a Philippine city.

He is among hundreds of civilians pinned down in pockets of Marawi that are controlled by the militants, and they are facing an onslaught of deadly threats including bombs, sniper fire, hunger and a lack of medical care.

Some have made a two-kilometer (1.2-mile) sprint to safety during the three weeks of conflict, risking being shot at by the militants, and Camalia waits every day at a secured government building nearby hoping her husband will run into her arms.

"It's really painful for me. I'm always scared he'll be hit," Camalia, 43, told AFP on Wednesday in a soft voice as she held back tears and anxiously fixed her hijab.

"He is too traumatized to escape. Even we on the outside are afraid because you don't know which direction the bullets are coming from."

The fighting began on May 23 when hundreds of militants rampaged through Marawi, the most important Muslim city in the mainly Catholic Philippines, waving the black flags of the Islamic State (IS) group.

They have since withstood a relentless, US-backed bombing campaign and intense ground battles with Filipino troops that have left large parts of Marawi resembling devastated cities in war-torn Syria and Iraq.

One of the keys to their survival has been the trapped civilians, who are acting as human shields in stopping the military from completely destroying the small areas controlled by the gunmen.

Even so, entire streets are now just full of rubble and the military's bombs have not always hit their targets -- with one strike going astray and killing 10 soldiers.

Most of the city's 200,000 residents fled during the early stages of the fighting. Authorities say anywhere between 300 and 1,700 civilians remain trapped in the militant-held areas.

Camalia's family was visiting a nearby town when the clashes began but her husband, Nixon, returned to check on their home and their hardware store.

Since then Nixon has been able to call her occasionally and report terrifying snippets of survival.

"He hasn't eaten. He hasn't slept. A bomb here, an explosion there. He is getting weak," she said at the provincial government office's entrance, from where she could see military helicopters bomb militant-controlled areas.

- Eating boxes -

Twenty-six civilians have been confirmed killed in the fighting.

But local officials and aid workers believe dozens more have likely died, with their corpses rotting in the militant-held areas, and that conditions are growing increasingly dire as food runs out.

"Some residents are eating (cardboard) boxes. They just dip it in water to soften the material and eat it," provincial crisis management committee spokesman Zia Alonto Adiong told AFP, recounting testimonies from people who escaped.

"It's heartbreaking. It's almost unbelievable to think that people are living this way."

The military has also reported that the militants are using some civilians as slaves, making them cook and carry munitions.

One survivor who escaped on Tuesday, Christian housepainter Nick Andeleg, 26, said he and his colleagues decided to flee after coming to the realiZation that waiting any longer would certainly lead to death.

"We thought we were the only ones left trapped. We felt it was better to try escaping. If we died outside our house, at least we tried to save ourselves," Andeleg told AFP as he recounted watching bombs destroy houses around him.

"We hid anywhere we could. We'd go under all kinds of furniture: beds, cabinets, in the toilet. We were like rats hiding under anything we could find."

Camalia Baunto, who has left her six children with her in-laws outside of Marawi, said she was determined to wait for her husband.

She appeared tormented by the wait though, mumbling to herself while sitting alone sometimes, and asking unanswerable questions to others at the government building.

"When is this crisis going to end? When will this chaos be over?"