Trapped in a war zone, Carmalia Baunto's husband, Nixon, had been trying for weeks to stay alive as Islamist guerrillas and Philippine government forces battled for control of Marawi City.

With the fighting raging around him, Nixon texted and called throughout, until just over a week ago when the messages stopped abruptly, leaving his wife praying that it was just his cellphone battery that had died.

"I'm OK, but I can't go out. The house is safe," the 41-year-old hardware store owner had told his wife in a message from their home inside the southern Philippines city.

He heard gunbattles in the street, he wrote, and hid from black-clad fighters who have pledged allegiance to Islamic State and have occupied the city's commercial district for a month.

On June 14, at 9:59 a.m., Nixon texted to ask Carmalia to buy him more credit for his phone, which she did.

Then the messages stopped, and his phone stopped ringing.

"I've had sleepless nights since then," Carmalia, 42, told Reuters at Marawi's government compound, where she has been sleeping in a mosque while awaiting word of her husband.

The couple and their children were out of town when fighting erupted in Marawi on May 23, but Nixon went in the next day to check on their home and got trapped. Like most of the city's residents, the family is Muslim.

Officials estimate 300 to 500 people are still trapped inside Marawi, fearful of militants accused of using civilians as human shields as much as of government airstrikes and starvation.

Some families have sent messages saying they have resorted to eating blankets or cardboard dipped in water to keep hunger at bay.

The Philippine military has said it is in the final stages of its operation to oust the insurgents, whose ranks contain local militants and foreign, battle-hardened fighters from Islamic State's campaigns in Syria and Iraq.

The fighters have put up tough resistance, exploiting the city's narrow streets, thick concrete walls and basements, and harassing troops with sniper fire and Molotov cocktails.

Philippines military aircraft - with technical assistance from U.S. special forces - have pummelled the city with 500-pound bombs, raising fears about the safety of civilians unable to get out.

In the early stages of the conflict, many people were texting and calling in their whereabouts.

Their best hope of getting out lies with a "peace corridor" initiative of President Rodrigo Duterte.

It comprises Philippine army officers and their former adversaries, fighters from the Moro Islamic Liberation Front, which signed a peace deal with the government in 2014.

The team says it has helped to evacuate 270 people since it was set up on June 4. It has also delivered supplies to those who remain behind.

Others have escaped by making their own way across the city, dodging sniper fire, to cross the Banggolo bridge over the Agus river and reach the government-controlled area.

BATTERIES RUN DOWN

But there is no power and water in the city. Phone batteries have now largely run down and the team has no way to contact most of those inside, including Nixon Baunto. He had used two phones, his wife said, and the power must have run out in both.

Families visiting the evacuation team's office on Wednesday provided 15 new names of loved ones they say are trapped in the city, according to Wendell Orbeso, a director at the Office of Presidential Adviser on the Peace Process.

Later, the team received a text saying 10 or more people were hiding out in a grocery store.

"We don't exactly know how many people are still there," Orbeso told Reuters at the office in a government building now mostly used to house evacuees.

The locations of the beleaguered civilians are passed to military commanders in the hope that soldiers can rescue them.

After flushing militants from the city's neighbourhoods, troops have moved house-to-house, watching out for booby traps that include cooking gas cylinders rigged to explode, Gen. Ramiro Manuel Rey told reporters in Marawi on Wednesday.

Carmalia has been told the army is close to clearing the militants from the area around her home, she said.

Nixon was too scared to leave the house, she said. He believed he would likely be captured by the militants or mistaken for a fighter and shot by the military, he told her.

He had survived by collecting and drinking rainwater.

Earlier in the siege, Nixon ventured out to a mosque, where he reported seeing more than 100 civilians sheltering, including women and children nursing gunshot wounds, he told his wife.

"He could not take the shooting, the bombing and the fear of stray bullets," she said, so he returned home, further from the epicentre of the battle.

"I pray to Allah every day, every night, every hour for this war to end so my family can be reunited," Carmalia said, wiping tears from her eyes.

She was desperate to have her husband back for the Eid al-Fitr festival this weekend, she said. "If he's not back, I have no interest in celebrating."