Defence chiefs announced on Monday that the fighting, which claimed more than 1,100 lives and left the eastern half of Marawi in ruins...
Defence chiefs announced on Monday that the fighting, which claimed more than 1,100 lives and left the eastern half of Marawi in ruins, had ended following a final clash in a mosque in which dozens of gunmen were killed.
The militants had occupied Marawi, the Islamic capital of the mainly Catholic Philippines, on May 23 in what President Rodrigo Duterte and security analysts said was a bid to establish a Southeast Asian base for IS.
The campaign to oust them turned into the Philippines' longest urban war, forcing about 400,000 people to flee their homes as the militants defied near daily bombing raids by hiding in basements, tunnels and mosques.
"We are afraid but we want to check on our houses," Jamaliah Lomontong, a village official in her 40s, told AFP on Tuesday as she and some relatives walked into their neighbourhood near where the main fighting occurred.
Lomontong said her house had survived, although it had been looted.
"Anything easy to take away has gone -- televisions, laptops," she said.
Only a few dozen civilians could be seen on Tuesday morning on the outskirts of the mostly destroyed eastern half of Marawi, where regular bursts of gunfire and occasional explosions could still be heard.
However the sounds of war did not mean there was renewed fighting, according to Colonel Romeo Brawner, deputy commander of Marawi forces.
He told AFP they were due to soldiers going through buildings looking for militants who may still be hiding, while troops were also detonating bombs that the gunmen had planted.
"It's possible that there were some (militants) left behind. In every war, that is the SOP (standard operating procedure)," Brawner told AFP.
"So the firing is part of the mopping operations, because if there are holes, tunnels (in buildings), then the troops fire first into the hole before they check with their flashlights," he said.
In the western half of the city, which largely escaped the fighting, hundreds of residents had begun returning.
"I feel a mixture of joy and sadness," businessman Gonaranko Mapandi Jnr, 46, told AFP as he stood close to a military checkpoint.
"I'm happy because we are able to return. But I'm very sad at what happened to my city."
Some small shops selling daily household items and food, known locally as sari-sari stores, had reopened.
However the authorities said the military had yet to give the all-clear for residents to return because of safety concerns.
And even when they do, large parts of the city would be uninhabitable with a multi-billion-dollar rehabilitation programme expected to take years to complete, according to local government officials and aid workers.
Duterte has warned in recent days that, even with the defeat of the militants in Marawi, others may be hiding in nearby cities or elsewhere in the southern Philippines and planning further attacks.
Eric Alarcon, head of the Philippine Red Cross's operations for Marawi, said many residents may never return to the city because of security fears or because they would not be able to live in destroyed neighbourhoods.
"There are a lot of factors. Some are just afraid that this is just a brief peace. Afterwards, there will be fighting again. They don't want their children to be affected," Alarcon told AFP.
"Others are looking for a new livelihood, a new business. Maybe they want a place where they can sustain their business."
Duterte declared martial law across the southern third of the Philippines, home to about 20 million and many of the nation's Muslim minority, immediately after the Marawi conflict erupted.
He said military rule was needed to contain the spread of a violent and extreme brand of Islamic militancy that was inspired or led by IS. Martial law has not been lifted despite the end of the conflict.