The United States is grappling with a hardening reality: Islamic State terrorism is on the rise in Southeast Asia, and it could worsen as foreign fighters abandon the battlefields of Iraq and Syria for new regions.

The issue has snapped sharply into focus in the past three weeks, as militants and Philippine security forces have been locked in a bloody fight for Marawi, a lakeside city of about 200,000 people in the southern Philippines.

Philippine President Rodrigo Duterte declared martial law May 23 on Mindanao, hundreds of people have been killed, and most residents have fled. Philippine aircraft, including the Vietnam War-era OV-10 Bronco, have leveled buildings with airstrikes.

Philippine military officials have said the militants’ main goal is to raise the Islamic State flag over the Marawi city hall, declaring a new “wilayat,” or province. Doing so would firmly plant the Islamic State brand on Mindanao, a Philippine island that has long been home to militant groups that were more locally focused.

The issue was at the forefront of discussions that Defense Secretary Jim Mattis had this month while attending the Shangri-La Dialogue, a major regional defense conference in Singapore. Mattis and senior defense officials from other countries all highlighted the situation, and the Pentagon chief urged others to act immediately.

“Together we must act now to prevent this threat from growing,” Mattis told a roomful of delegates at one point. “Otherwise, it will place long-term regional security at risk and stunt regional economic dynamism. We need only to look at the chaos and violence that our friends in the Mideast are contending with to see why we must swiftly and jointly address threats to our region.”

The issue is complicated by Duterte lauding the extrajudicial killing of thousands of drug dealers and users in the Philippines over the past year. The State Department noted the killings in a report this year, with U.S. officials saying that while they want to work with the government in Manila on areas of mutual interest, they have concerns about killings by both Philippine police and vigilantes.

Three U.S. officials, speaking on the condition of anonymity because of the diplomatic sensitivity of the issue, said last week that the Pentagon was open to providing assistance, but that the Philippines had not asked for any. That changed in the past few days as U.S. officials acknowledged that they were helping the Philippine military with undisclosed technical assistance. Duterte said in an interview Sunday that he was not aware of the assistance until it arrived.

The Pentagon established a counterterrorism mission known as Operation Enduring Freedom-Philippines a few months after the attacks of Sept. 11, 2001. Up to 600 U.S. Special Operations troops at a time assisted the Philippine military in the following years, occasionally facing combat despite their advisory role. The operation ended in 2015, as U.S. forces retired a Special Operations task force based on Mindanao while promising to continue assisting Philippine military leaders with operational planning.

Army Maj. Kari McEwen, a spokeswoman for U.S. Special Operations Pacific, said that since the U.S. counterterrorism mission in the Philippines ended, there have been anywhere between 50 and 100 U.S. Special Operations troops in the country at a time. They are assisting “with ongoing operations in Marawi,” she said. She declined to provide additional details, citing security concerns.

“We’re helping based on what their administration wants and how and where the [Armed Forces of the Philippines] sees that we can fit in,” she said. “We’re still in the same locations and we’re still advising and assisting.”

The Trump administration — which has pledged to annihilate the Islamic State wherever it goes — also continues to provide weapons and military equipment to the Philippines, as the United States has for years. Most recently, M4 carbines, Glock pistols, M134D machine guns, grenade launchers and rubber maritime raiding craft were delivered, according to a June 5 news release from the U.S. Embassy in Manila. Last year, the United States sent helmets, radios and a RQ-11B drone.

A spokeswoman for the U.S. Embassy in Manila, Emma Nagy, said that U.S. Special Operations have provided the Philippine government with support for years, and will continue to do so.

“As we have in the past, we routinely consult with our Filipino partners at senior levels to support the Duterte administration’s counterterrorism efforts,” she said. “The United States is a proud ally of the Philippines, and we will continue to work with the Philippines to address shared threats to the peace and security of our countries, including on counterterrorism issues.”

The Philippine embassy in Washington did not respond to requests for comment.

Analysts said that there are signs that the security situation on Mindanao has been changing. They include several militant groups pledging allegiance to the Islamic State in 2014, and the group releasing its first video about the Philippines in June 2016, according to a new report released by the U.S. Military Academy’s Combating Terrorism Center.

The video named Isnilon Hapilon, also known as Abu Abdullah al-Filipini, as the Islamic State’s emir in the Philippines. The slender, 5-foot-6 jihadist has fought against the Philippine government for years, is on the FBI’s list of Most Wanted Terrorists and is a leader of the region’s violent Abu Sayyaf group. He and another sect of militants known as the Maute group — named after the brothers in charge of it — led the attack on Marawi.

The Combating Terrorism Center report also said that between June 2014 and April 2017, there were 20 terrorist attacks, 35 plots and 88 arrests for support of the Islamic State in Southeast Asia. Half of the attacks occurred in the Philippines, but Malaysia, Indonesia and Singapore all recorded plots either linked to or inspired by the Islamic State, the study found.

Joseph Liow Chin Yong, a professor in Singapore who has studied the Islamist threat in the region and testified before Congress about it last year, said that a stated goal of Operation Enduring Freedom-Philippines was to stop the Abu Sayyaf group, but its forces are even stronger now that they have realigned with the Islamic State. Malaysia and Indonesia are also increasingly concerned about the southern Philippines being used to launch operations in their countries, he said.

“I think that definitely there is a role for the U.S. to play,” the professor said. “I believe it is a matter of American interests as well, because you are talking about what is potentially the manifestation of a larger, global problem regarding this very virulent ISIS ideology.”

Don Rassler, who helped compile the report for the Combating Terrorism Center, said that a key question going forward is whether the militants in Marawi can regroup. They have sizable numbers and the ability to project force into urban areas, he said.

“My guess is we’ll probably just continue to see similar events,” he said. “The test for the Maute group is whether they can replenish their ranks and maintain any kind of territory.”