The Philippines' President Rodrigo Duterte declared martial law in the southern island of Mindanao on Tuesday, after a group of militants affiliated to the Islamic State militant group (ISIS) stormed the island's capital city.
After Philippine troops raided a hideout in search of Isnilon Hapilon, who is reportedly the Islamic State leader in Southeast Asia, fighters from the Maute group attacked the city of Marawi. Residents were urged to stay indoors as violence broke out between the militants and security forces. As of Saturday, the city remains under rebel control.
Duterte has declared martial law—the suspension of ordinary law and implementation of military rule, for the entire island of Mindanao—and suspended habeas corpus there, giving authorities the right to detain prisoners without trial. The second largest island in the Philippines, it is home to a number of militant groups, including Abu Sayyaf and MILF (Moro Islamic Liberation Front). Presidential spokesman Ernesto Abella said: "This is possible on the grounds of existence of rebellion because of what is happening in Mindanao."

Martial law can last up to 60 days, and Duterte has long promised to impose it in Mindanao, which is known for its militancy and associations with Islamism. The Philippines is a Christian majority country, but since 2016, there have been concerns that the southern Philippines could become a de facto "wilayat" or Islamic State province. How likely is this?
What happened in Marawi?
As militants took over Mindanao's capital city, they released prisoners, captured Christians, and set fire to buildings, Reuters reported. Thousands of residents fled the region Wednesday.
Several fighters involved in the attack were reportedly from Malaysia and Indonesia. Mujiv Hataman, governor of the Autonomous Region in Mindanao, told Reuters that the militants had freed 107 prisoners, including Maute rebels.
Duterte's spokesman announced Tuesday the president would cut short his five-day visit to Russia to address the situation in the Philippines.
"You can say that the ISIS is here already," Duterte told soldiers Friday in nearby Iligan City. "My message mainly to the terrorists on the other side is we can still solve this through dialogue. And if you cannot be convinced to stop fighting, so be it. Let's just fight."
Security expert Rohan Gunaratna told Reuters that the siege needed to be a wake-up call for the Philippines. "Islamic State capturing a major city in the Philippines is a very significant blow to the security and stability of this region. The Filipinos need to get their act together... They must understand the truth that ISIS ideology took hold in their country. The local groups have transformed."
Duterte rose to power as mayor of Davao City, the largest city in Mindanao, and won his election campaign partly owing to his promises to bring stability and peace to the country.
Who are the Islamist groups in Mindanao?
Mindanao is an island the size of South Korea, with 22 million residents. The Philippines' southern islands have been plagued by Islamist groups who are attempting to create a caliphate in the region's south.
MILF is a militant group seeking the creation of an autonomous state, which has shown a willingness to cooperate with the government to achieve this end.

Abu Sayyaf is a jihadi group with links to ISIS in the southern Philippines, and it also supports the insurgency efforts to create a separate Islamic state in the region. The group is well-known for hijacking ships, kidnapping and beheading foreigners and locals to extort money. Its founder, Abdurajak Abubakar Janjalani, was said to have been inspired by Osama Bin Laden.
The Maute group is led by Omar and Abdullah Maute, and has pledged allegiance to the Islamic State. Former Middle Eastern contract workers, the brothers studied Islamic theologies while they were working, and returned to the Philippines to promote a "Taliban-style justice system which Mawaranis find ruthless and absolutely primitive," according to the Phil Star newspaper.
Maute is believed to have just 80-100 members, which makes them small fry when compared to other Islamist groups in the Philippines. Maute are thought to be part of the Khilafah Islamiya Movement, a hardcore militant Islamic group.
The group tried to detonate a bomb by the the U.S. embassy in 2016, and its members claimed responsibility for a night market bombing in Davao City that killed 15.
Maute is believed to be involved in the drugs trade, and in March, Alberto de la Rosa, head of the Philippines' Security forces, said he believed the group had established a presence in Manila, the country's capital.
The Philippines solicitor general, Jose Calida, said it was the goal of the Maute Group and Abu Sayyaf, to create an "ISIS" province in Mindanao. He told Reuters: "People they consider as infidels, whether Christians or Muslims, are also targets," he said. "What is worrisome is that the ISIS has radicalized a number of Filipino Muslim youth."
Is martial law a sign of creeping authoritarianism in the Philippines?
Human rights groups have raised concerns about Duterte's imposition of martial law and the suspension of habeas corpus in Mindanao. "The imposition of martial law in the midst of Duterte's 'war on drugs,' in which more than 7,000 people have been killed since June, raises grave concerns of ever-widening human rights violations in the country," Human Rights Watch (HRW) said.
It is not the first time martial law has been implemented in the Philippines. In 1972, President Marcos imposed martial law, which led to widespread abuses by the security forces, including torture, enforced disappearances, and extrajudicial killings.