Filipino forces have liberated a southern town that was overrun by Muslim militants with ties to the Islamic State.

“There are no more militants inside Marawi,” Defense Secretary Delfin Lorenzana told reporters Monday, declaring victory after a five-month campaign to retake the city after it was taken hostage by hundreds of Maute and Abu Sayaff militants, radical extremists who have sworn allegiance to ISIS and fly the same black flag in battle.

The bloody fight has left more than 1,100 people dead and hundreds of thousands displaced.

The conflict began in late May when government security forces attempted to capture Abu Sayaff leader Isnilon Hapilon in Marawi. A firefight broke out between the militants and the Filipino forces. Shortly thereafter, hundreds of Maute reinforcements stormed the city, taking over critical points. The terrorists burned schools and churches, raised their black flag above captured government buildings, and took hostages, many of which were local Christians. (RELATED: ‘We’re Not Okay Here’: Filipino City In Flames As Battle Rages With ISIS-Linked Militants)

The Armed Forces of the Philippines initially expected to be able to retake the city in a week, underestimating its enemy. The militants had apparently planned the assault weeks in advance, building tunnel networks beneath local mosques, acquiring heavy weaponry, and stockpiling essential supplies.

The presence of foreign fighters among the militants, as well as ISIS propaganda urging its followers to take up arms for the caliphate in Marawi, raised alarms in the Philippines, as many feared that ISIS intended to use this fight to open up a new front as its power crumbles in the Middle East. A number of observers suspected the conflict in Marawi could be used to secure a foothold in Southeast Asia for the spread of radical Islamic terrorism. (RELATED: Philippines Becomes Hotbed For ISIS Activity As Foreign Jihadis Join The Fight)

To eliminate the terrorist threat in Marawi, Filipino troops were forced to level the city with constant air strikes and bombing runs. The pictures of Marawi are not that different from those of Mosul or Raqqa, the liberated ISIS capitals in Iraq and Syria.

Hapilon and Omarkhayam Maute were killed last week. The latter took a sniper bullet to the head while trying to cross the street during combat. Troops mopped up the last of the terrorists in Marawi recently, ending the siege once and for all. (RELATED: Sniper Puts A Bullet Through The Head Of ISIS Leader Who Devastated US Ally)

“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 Monday. “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.”

Victory was hard won and came at great cost. Among the fallen were 165 soldiers and police.

The campaign to liberate Marawi was supported by the U.S., with American troops providing a certain degree of intelligence and reconnaissance assistance, as well as firearms. China also provided weaponry to assist in the fight, including the sniper rifle that killed the Maute leader.

Follow Ryan on Twitter

Send tips to ryan@ dailycallernewsfoundation.org.

Content created by The Daily Caller News Foundation is available without charge to any eligible news publisher that can provide a large audience. For licensing opportunities of our original content, please contact licensing@dailycallernewsfoundation.org.