For about two weeks now, dozens of Islamist militants have faced off against the Philippine armed forces in the city of Marawi, on the southern island of Mindanao, where most of the Philippines’ Muslim minority lives. The pitched battle, which is unusually fierce even by the standards of this conflict-prone part of the country, indicates that the Islamic State is now also a Southeast Asian problem and that the Philippine government may be the region’s weak link in addressing it.

While President Rodrigo Duterte focused his energies during his first year in office on waging a brutal campaign against suspected drug dealers and users, a motley coalition supporting the Islamic State — former guerrillas, university students, scions of political families, Christian converts to Islam — grew into a fighting force with surprising staying power. Mindanao has long been home to insurgencies, but the advent of this coalition, which is more ideological and has closer links to Islamists abroad than any local group before it, marks the government’s failure to understand how the nature of extremism in the Philippines has changed.

Pro-autonomy armed rebellions have been active in Mindanao since the 1970s. The Moro National Liberation Front (M.N.L.F.) reached a peace agreement with the government in 1996, but factions that disliked some of the deal’s terms continued to fight. The Moro Islamic Liberation Front (M.I.L.F.), a splinter group with some 12,000 fighters, began negotiations the same year and nearly reached a final settlement under Mr. Duterte’s predecessor. But the peace process collapsed in early 2015 and despite a few initiatives by the new government, it remains stalemated.

Foreign terrorists have periodically appeared on the margins of the insurgencies, notably from Al Qaeda in the mid-1990s and later Jemaah Islamiyah, an Indonesia-based extremist organization. In 2005, when the M.I.L.F. expelled a small group of these men to pursue talks with the government, they joined Abu Sayyaf, another splinter group that opposed the M.N.L.F’s deal with the government. Based in the Sulu Archipelago, southwest of Mindanao, Abu Sayyaf wanted an Islamic state for Muslim Mindanao. The group became known for various kidnap-for-ransom activities, but through the mid-2000s it also welcomed foreign terrorists seeking refuge.