Marawi, situated on the southern island of Mindanao in the Philippines, was the site of a bloody urban battle between ISIL fighters and government forces.
Officially known as the Islamic City of Marawi, it is the largest Muslim city in the predominantly Catholic nation.
ISIL fighters laid siege to the city in May, prompting months of heavy combat that prompted hundreds of thousands to flee and left more than 1,000 dead.
On May 23, 2017, government forces clashed with armed fighters from two ISIL-affiliated groups - Abu Sayyaf and the Maute. The siege was triggered when the military tried to arrest top ISIL leader Isnilon Hapilon.
This prompted attackers to fight back, declaring the city a new caliphate of ISIL, or the Islamic State of Iraq and the Levant group, also known as ISIS.
They burned a Catholic church, the city jail and two schools before occupying the main streets and major bridges of the city. Churchgoers and residents were taken hostage and a police officer was beheaded.
On the evening of the attacks, Philippine President Rodrigo Duterte declared martial law across the entire island of Mindanao. Initially, Duterte predicted the battle would be over within weeks.
Top commanders Isnilon Hapilon and brothers Abdullah and Omar Maute were members of the local armed groups, Abu Sayyaf and the Maute. Both groups have previously been blamed for bombings, attacks against government forces and kidnappings in the Philippines.
The battle involved many foreign fighters, from countries like Malaysia and Indonesia, as well as Yemen and Chechnya. There is evidence that the groups also recruited a large number of child soldiers, many from local schools in Marawi.
In the early days of the siege, residents were advised to stay locked indoors until troops arrived. But as the fighting continued, many fled for their lives. Over the past five months, about 300,000 people were forced to evacuate their homes and stay in temporary shelters outside the city.
Government agencies warned that the violence in Marawi was causing a humanitarian crisis.
Many of the people in the evacuation camps were poor even before the conflict started. With the city destroyed, residents are unable to return home and continue to suffer from dehydration, infections and waterborne diseases. Basic sanitation facilities, food and medical supplies are limited.
The capture of Marawi led to the longest siege by armed fighters in the Philippines. On October 16, government troops stormed a hideout, killing both Hapilon and Maute. The next day, Duterte declared the city "liberated" even as sporadic fighting continued.
On October 23, five months to the day from the start of the siege, Delfin Lorenzana, Philippine defence minister, declared there were no more "militants" in Marawi after troops overpowered the remaining fighters.
The bodies of 40 suspected gunmen, and two of their wives, were found following the final stand.
Soldiers are still looking for the three sons of Isnilon Hapilon, who are believed to be capable of taking over the leadership and continuing the fight.
The battle resulted in the deaths of 920 fighters, 165 government soldiers and at least 45 civilians. Officials say martial law will continue to be implemented in Marawi and the surrounding Mindanao area as sporadic fighting continues there.
The historic city has been left in ruins and it's unclear when citizens will be able to return home.
The government estimates it will cost around $1.1bn to rebuild the city, a task that could take years.
The government is working on a peace deal that will give the predominantly Muslim region more autonomy.
Lorenzana says the end of the violence signals the importance of regional cooperation in the fight against "terrorism" in the Philippines and its neighbouring countries.
Still, experts have warned of possible future attacks from other armed groups in the region that have pledged allegiance to ISIL.
Source: Al Jazeera News