The Philippine government declared the end Monday to the militant siege of a southern city that lasted five months, left more than 1,100 people dead and sparked fears of the militant Islamic State (IS) group gaining a foothold in Southeast Asia.
Speaking at an annual meeting of the region's defence ministers, Defence Secretary Delfin Lorenzana told reporters that combat operations in Marawi were ending after troops recovered 42 bodies of the last group of militants.
"Those are the last group of stragglers of Mautes and they were caught in one building so there was a firefight, so they were finished," he said. "There are no more militants inside Marawi City."
The siege had sparked fears the IS group would influence, fund and strengthen local militancies as it was losing ground in Syria and Iraq. The defeat of the IS-linked uprising and the deaths of its leaders have been a relief to the region.
"The Philippine security forces, aided by its government and the massive support of the Filipino people, have nipped the budding infrastructure and defeated terrorism in the Philippines," Lorenzana said.
He said the achievement shows how regional cooperation can contain the spread of terrorism.
"In crushing thus far the most serious attempt to export violent extremism and radicalism in the Philippines and the region, we have contributed to preventing its spread in Asia."
Fighting terrorism is high on the agenda of the Southeast Asian defence ministers' meeting at the Clark freeport north of Manila.
As the meetings opened, the head of the Brunei delegation expressed condolences for the loss of lives in Marawi but congratulated the Philippines for being able to liberate the city.
Malaysia's minister said the siege was a wakeup call for the region.
"We have to be very careful. What happened in Marawi can happen anywhere," Defence Minister Hishammuddin Hussein said.
Hundreds of militants, many waving IS group-style black flags, launched the siege on May 23 in Marawi, a bastion of Islamic faith in the south of the largely Roman Catholic Philippines, by seizing the lakeside city's central business district and outlying communities.
They ransacked banks and shops, including gun stores, looted houses and smashed statues in a Roman Catholic cathedral, according to the military.
The fighting has left at least 1,131 people dead, including 919 militants and 165 soldiers and police.
At least 1,780 of the hostages seized by the militants, including a Roman Catholic priest, were rescued.
The final group of 20 captives were freed overnight, Army Col Romeo Brawner said at a news conference Sunday.
That left the gunmen with none of the hostages they had used as human shields to slow the military advance for months.
The disastrous uprising, which has displaced hundreds of thousands of Marawi residents, erupted as the Philippines was hosting annual summit meetings of the Association of Southeast Asian Nations this year, along with the 10-nation bloc's Asian and Western counterparts, including the United States and Australia.
The two governments have deployed surveillance aircraft and drones to help Filipino troops rout the Marawi militants.
Last week, troops killed the final two surviving leaders of the siege, including Isnilon Hapilon, who is listed among the FBI's most-wanted terror suspects in the world, and Omarkhayam Maute.
Following their deaths, President Rodrigo Duterte travelled near the main scene of battle and declared Marawi had been essentially liberated.
DNA tests done in the United States (US) requested by the Philippine military have confirmed the death of Hapilon, according to the US Embassy in Manila.
Washington has offered a bounty of up to $5 million for Hapilon, who had been blamed for kidnappings for ransom of American nationals and other terrorist attacks.
Among the foreign militants believed to be with the remaining gunmen in Marawi were Malaysian militant Amin Baco and an Indonesian known only as Qayyim.
Both have plotted attacks and provided combat training to local militants for years but have eluded capture in the south.
Lorenzana said Monday the identities of the final 42 bodies had not been determined and some were beyond recognition.