New photos show how the five-month battle to retake Marawi from pro-Islamic State (Isis/Daesh) fighters has left the city in ruins. No building was spared in the centre of the city in the southern Philippines where the fiercest fighting took place, and most structures have been reduced to rubble.

Marawi Philippines
Damaged houses, buildings and a mosque are seen in Marawi Romeo Ranoco/Reuters

On Monday (23 October) the Philippines announced the end of combat operations in Marawi after troops killed 42 remaining militants, including some foreign fighters. Military air strikes, artillery and heavy machine-gun fire have turned the lakeside city's central business district and outlying communities into a smouldering wasteland of shattered buildings and bullet-pocked mosques and houses.

The Philippines government estimates the rebuilding of the heart of Marawi could cost in excess of $1 billion (£760m).

Authorities have begun raffling off the first batch of temporary shelters for those who lost their homes to the five-month battle to retake the city. More than 1,000 transitional houses, with basic bathroom and cooking facilities, could be completed within two months on the outskirts of Marawi, the Philippine housing agency has said. Residents whose homes were devastated will get first priority in allotment raffles that could be held either before or after construction.

The social welfare department said more than 5,000 families still live in covered gymnasiums and tent cities.

The siege, which was launched by militants from the Isis-linked Maute group on 23 May, left more than 1,100 combatants and civilians dead, including more than 900 militants, and displaced some 400,000 residents, including the entire population of Marawi, a bastion of the Islamic faith in the predominantly Roman Catholic Philippines.

General Eduardo Ano, who oversaw the military campaign, said the massive offensive led to the killings of at least 10 key terror suspects from different extremist groups that have pledged allegiance to Isis, including Isnilon Hapilon, four siblings belonging to the local Maute clan, and Indonesian and Malaysian militants. Ano said it would have taken five to 10 years for troops to hunt down and find all those militant leaders in the jungles of the south.

The leaders of the bloody insurrection, who came from different ethnic backgrounds, were linked by their desire to be recognised by Isis as its Southeast Asian branch and obtain funding from the Middle East-based group. When the militants forged an alliance, Isis sent $1.5 million (more than £1.1m) to finance the attack, Ano said, citing intelligence information, including some provided by the US.

He said the defeats of Isis in Syria and Iraq, and now in Marawi, show a major vulnerability of the extremists: Their audacious territorial occupations tend to crumble over time as they're cornered in urban settings by the relentless firepower of US-backed offensives. The counterterrorism victories have given governments confidence that Isis can be stopped and defeated.

"They underestimated the reaction of the different countries in the world, the alliances," he told AP. "With what happened in Mosul, the Philippines and Raqqa, the different countries are now confident that if ever an Isis siege would erupt ... they now have the recipe or the formula to fight it."

Ano said the Marawi militants, like their Middle East counterparts, were blindsided by their ambition and miscalculated the response to their plot, which involved the seizure of a military camp in Marawi. "They thought that they can get the helicopters and armoured vehicles and the people of Marawi would protect them, and there would be a flag flying and they could call it their own, an enclave, and probably more foreign fighters would come," Ano said.

Tens of thousands of Marawi residents, however, abandoned the city in panic and troops managed to secure Marawi's military camp and other vital areas. The United States and Australia later deployed surveillance aircraft that provided real-time images of militant positions, even at night — modern warfare technology that, coupled with the tenacity of Filipino troops, became a "game changer" in the massive effort to liberate the city, Ano said.

The military firepower was designed to push the militants to a coastal area where they could be overcome more easily, said the veteran combat general, who called the Marawi offensive the greatest battle of his military career. He retires on Thursday (26 October). "We designed a very good campaign to flush them out and pressure them and channel them into the chosen engagement areas," he said. "We call it constriction."