The government of Philippines on Monday announced that its five-month-long military operation against the Islamic State in Marawi had ended, AP reported. The combat operations in the southern city, which began in May, ended after troops recovered 42 bodies of the last group of militants, said Defence Secretary Delfin Lorenzana.

At least 45 civilians, 920 militants and 165 soldiers and police officers died in the conflict, authorities said. More than three lakh people were displaced.

“In crushing thus far the most serious attempt to export violent extremism and radicalism in the Philippines and in the region, we have contributed to preventing its spread in Asia,” Lorenzana said, adding that Filipino security forces had “nipped the budding infrastructure” of terrorism in the country, Reuters reported.

The defence secretary said the last group of militants were caught in a building and a gunfight followed. “There are no more militants inside Marawi,” he said, adding that at least six battalions of troopers will remain in the city to be on the lookout for stragglers.

He also thanked the United States, Australia, China and Singapore for providing weapons to fight against extremism.

On October 16, military forces had killed Isnilon Hapilon, a militant who had pledged his alliance to the Islamic State group in Southeast Asia. Hapilon was named in the US Federal Bureau of Investigation’s list of most-wanted terrorists. After Hapilon and another militant’s deaths, Philippines President Rodrigo Duterte had declared Marawi liberated.

The government of Philippines was criticised for the slow pace at which Marawi was recaptured from militant control. It is the only region with a Muslim-majority population in the otherwise largely Catholic country.