The months-long siege of Marawi is effectively over. In recent weeks, the Armed Forces of the Philippines (AFP) managed to neutralise the top leadership of the Islamic State in Iraq and Syria (ISIS)- affiliated movement in Mindanao.
The deaths of Isnilon Hapilon, the designated "emir" of the ISIS movement in South-east Asia, as well as the Maute brothers, the top military commanders who oversaw the siege of Marawi, mark a major setback for extremists in the region.
New leaders will predictably emerge, but it is highly doubtful whether they can mobilise a similarly lethal and audacious urban siege any time soon. The spectre of an ISIS wilayat (governorate) has been contained - at least for now.
Yet, the war against extremism is far from over. If anything, the Philippines and the broader South-east Asia area should now prepare for much-vaunted "spectacular terror attacks". The remnants of the ISIS movement in Mindanao will certainly try to prove that they are still alive and kicking.
For now, the Philippine government seems to be in a triumphalist mode after a hard-fought military victory in Marawi. President Rodrigo Duterte triumphantly declared earlier this month: "Marawi city (is) liberated from the terrorist influence." A few days later, his Defence Minister Delfin Lorenzana announced: "There are no more militants in Marawi."
The military claims to have killed as many as 800 militants, including Mahmud Ahmad, the Malaysian financier who served as the bridge between ISIS leadership in the Middle East and the Maute group in the Philippines.
Few, however, missed the fact that it took the military almost five months to wrest control of the city from militants. Regional militant terror networks have predictably been inspired by the ability of their Filipino comrades to hold onto a relatively large city against a legion of government troops backed by major powers.

On the one hand, this reflects the inherent weaknesses of the AFP, which has had minimal training and experience in modern urban warfare. The other factor was the militants' effective use of cutting-edge insurgency tactics, ranging from pre-positioned snipers and intricate networks of underground tunnels to improvised explosive devices, which struck terror into the hearts of security forces.
However, the AFP should be commended for - on Mr Duterte's instruction - adopting a slow-but-sure approach to taking back the city. The (Christian-majority) military expressly avoided the destruction of holy sites such as major mosques in the pursuit of ISIS-affiliated militants.
They also focused on minimising civilian casualties and saving as many hostages as possible. These factors meant a more methodical and slow-motion encirclement of enemy positions over the course of months rather than days or weeks.
There were also intermittent ceasefires, which provided much-needed humanitarian corridors and opportunity to rescue hostages through negotiations via third-party interlocutors. As a result, the government managed to save as many as 1,700 hostages, including Catholic priest Teresito "Chito" Suganob.
Mr Duterte was committed to avoiding bloodshed among hostages, especially Christian ones, in order to prevent sectarian tensions in Mindanao and beyond.
HELP FROM EXTERNAL PARTNERS
But the AFP was far from alone in this fight. Assistance from traditional allies, particularly the United States and Australia - which provided real-time intelligence on enemy positions - proved decisive. Similar to Washington, Canberra also offered advanced counter-terror equipment and training, while contemplating the deployment of special forces to affected areas.
Mr Duterte managed to also secure assistance from non-traditional strategic partners such as Russia and China, which provided intelligence as well as equipment. Neighbouring states such as Malaysia and Indonesia also helped coordinate patrols in their tri-border with the Philippines to restrict the flow of foreign fighters into Mindanao.
The constant flow of external assistance progressively diminished the AFP's deficiencies in coping with its first - and brutal - experience of full-scale urban warfare.
For now, the Philippine government is committed to maintaining the martial law declaration across Mindanao to counter terror plots, eliminate other ISIS-affiliated militants, and crack down on sleeper cells in major urban centres in the area.
It is also bent on eliminating the presence of "foreign fighters" in Mindanao in order to deny any further operational coordination between the Syria-based transnational terror group and local Islamist elements.
In previous months, Mr Duterte's primary mission was to nip the prospect of an ISIS wilayat in the bud. So far, he seems to have achieved that aim, albeit at a very high cost.
The war against extremism, however, is ultimately non-military. The bigger challenge, therefore, is the reconstruction of Marawi, the Philippines' largest Muslim-majority city, which has been reduced to rubble.
Reconstruction of the city as well as reintegration of as many as 600,000 displaced residents will be an uphill battle - necessitating major fiscal allocation, proper administration and external development aid.
The other urgent task is the revival of deadlocked peace negotiations between the government and major rebel groups, particularly the Moro Islamic Liberation Front. Restoration of peace and development is essential to combating extremism.
These non-military challenges may prove even more elusive than the hard-fought liberation of Marawi. But the Philippines cannot risk recreating the very ecosystem of grievance and disenchantment that gave birth to the Marawi crisis.
•The writer is a non-resident fellow at Stratbase ADR Institute in the Philippines and author of The Rise Of Duterte: A Populist Revolt Against Elite Democracy.
•S.E.A. View is a weekly column on South-east Asian affairs.