A recent string of violent episodes in Southeast Asian countries sheds some light on the challenges facing this region as it grapples with extremism.
In Indonesia last month, two suicide bombers blew themselves up at a Jakarta bus station. The attack was linked to an ISIS-affiliated group.
In Thailand, a rash of attacks linked to Islamist insurgent groups took place throughout April and into May in the restive, Muslim-dominated south — including a car bomb attack outside a shopping mall that wounded more than 50 people.
And in the Philippines, ISIS-linked militants recently took over and occupied Marawi, a city in the country's Muslim-majority island of Mindanao. President Rodrigo Duterte declared martial law on Mindanao on May 23, and the Philippine army has been fighting the militants for almost three weeks. The death toll has topped 150, according to the military.
The attacks raise important questions about the extent of militancy and potential threats in this region.
The Islamist groups battling the Philippine military in Marawi — including the well-established Abu Sayyaf and a newer group, called Maute -- have only recently come together under the ISIS flag. And they've been getting some help from abroad, analysts say.
"We see the southern Philippines emerging as an important venue for foreign terrorist fighters," Rohan Gunaratna, the head of Singapore's International Centre for Political Violence and Terrorism Research, tells NPR. Foreign fighters from countries including India, Indonesia, Malaysia, Yemen and Saudi Arabia have been among those killed in the battles in Marawi, he says.
Sidney Jones, who tracks militant groups in Southeast Asia as director of the Jakarta-based Institute for Policy Analysis of Conflict, says as ISIS continues to lose territory in the Middle East, fighters are looking elsewhere.
"If you can't go to Syria," Jones says, they think, "go to the Philippines."
Since its independence from the U.S. in 1946, the Philippines has grappled with an alphabet soup of separatist, Islamist groups in Mindanao. This years-long struggle has made the region a sanctuary for such groups, and fighters are drawn there by porous borders and a growing inability to make it to Syria.
Jones says she expects to see more ISIS-directed and ISIS-inspired attacks in the region as a result.
Philippines and beyond
The Philippines, she says, is just one alternative theater that's opened up in the region. A similar situation could develop along the border of Bangladesh and Myanmar, where hundreds of thousands of Rohingya Muslims have attempted to flee persecution.
An armed Rohingya insurgency already operates along this border. A recent report by Jones' organization calls this insurgency the "wild card" in a growing collaboration between Islamist militants in Bangladesh and Southeast Asia.
Jones predicts that in the coming years, extremists from Southeast Asia may try to get to Myanmar to join Rohingya insurgents. "Indonesian and Malaysian mujahidin have long been interested in helping their persecuted Rohingya brethren but have had no good channel for doing so," her organization's report says.
Meanwhile, Jones sees a shift in what's driving Islamist attacks in Southeast Asia. Where they often used to be triggered by local factors — such as a sectarian conflict between Indonesia's Christians and Muslims that triggered a deadly bombing in 2002 by Jemaah Islamiyah (with some support from al-Qaida) in Bali that killed more than 200 — now, fighters are inspired by what's going on thousands of miles away in Syria and Iraq.
Another growing concern in Southeast Asia is a rise in political extremism, particularly in Malaysia and Indonesia.
A "tactical, opportunistic use of hard-line Islam could have serious negative effects on the quality of democracy in those two countries," Jones says.
A recent survey found that 9.2 percent of Indonesia's population supports the imposition of an Islamic caliphate. Indonesia is the world's most populous Muslim-majority country.
Terrorism experts say the recent case of Basuki "Ahok" Tjahaja Purnama, the Christian former governor of Jakarta, illustrates the dangers. In April, he lost his re-election bid to a Muslim candidate. He had been charged earlier with blasphemy, and in May, he was convicted and sentenced to two years in prison.
The blasphemy charge stemmed from an accusation on the campaign trail last September. The governor told a group of fishermen that any politician who quoted the Quran to say they should not vote for a non-Muslim candidate was lying to them. But he also advised them to vote their conscience.
Some conservative Muslims and local hard-line Islamist organizations, such as the Islamic Defenders Front, took offense to this. Ahok later apologized and said he never intended to insult the Quran or Islam.
Andreas Harsono, a Human Rights Watch researcher based in Jakarta, says the Islamist groups asked the Indonesian Ulema Council, the country's Islamic authority, to issue a fatwa declaring Ahok committed blasphemy — which the council did in October.
This "automatically divided Muslim voters, getting a lot of Muslims who believe they cannot vote [for] a blasphemer, plus mobilizing Muslims to pressure the national police to charge Ahok," Harsono says.
During the trial, many of the same groups pushed for Ahok to be found guilty.
The verdict was a win for the country's Islamists, says Harsono, who recently wrote in The Guardian they have been "emboldened by the government's inaction on discrimination and violence against religious minorities."
And even though the current president, Joko Widodo, is seen as a progressive, Harsono tells NPR that the government has not taken steps to undo any of the discrimination.
The verdict left Ahok's supporters and those hoping for a more pluralistic Indonesia feeling vulnerable, he adds.
"The pro-Ahok group feels angry," says Harsono. "The non-Muslims feel they are a minority being discriminated against ... that the government isn't doing enough to protect them."
Different agendas, new permutations
Terrorism expert Joseph Chingyong Liow, dean of Singapore's S. Rajaratnam School of International Studies at Nanyang Technological University, says it's important to keep the ISIS threat in perspective.
The number of recruited fighters leaving Southeast Asia for the Middle East to answer the call of ISIS is still a mere fraction of the number of recruits the Islamic State gets from North Africa and Europe, he says. So even as ISIS loses ground in Syria and Iraq, it seems unlikely that huge swarms of fighters would come back to Southeast Asia to continue their jihad.
Additionally, Islamist groups in Southeast Asia are diverse and the threat of terrorism is not confined to ISIS, he says.
"There are a number of different agendas and disputes among the jihadi groups," says Liow, ranging from ideology to disputes over tactics and targets. "Efforts to unite [the groups] have proved to be quite challenging," he says.
But even if an ISIS-affiliated group of fighters is defeated, he says, that does not mean the threat of terrorism in the region is under control.
"The threat of terrorism is not something new in Southeast Asia," he says. "Every time it appears to recede, some new permutation resurfaces."
This story includes reporting by Michael Sullivan.