Militants who have laid siege to a southern Philippines city had been planning a spate of attacks during the holy month of Ramadan to earn recognition as a regional branch of the Islamic State group, the military said Tuesday.

Soldiers have taken control of about 70 percent of Marawi, where the gunmen have been fending off the army for a week, military chief of staff Gen. Eduardo Ano said. About 100 militants, troops and civilians have been killed.

"They wanted to show the world that there is an ISIS branch here which can inflict the kind of violence that has been seen in Syria and Iraq," Ano told The Associated Press, using an acronym for the Islamic State group.

The violence followed an unsuccessful army raid that attempted to capture militant commander Isnilon Hapilon, who has been designated by the Islamic State group as its leader in the Philippines.

Hapilon escaped and gunmen loyal to him besieged this mostly Muslim city of 200,000 people, torching buildings and taking hostages. Ano said the gunmen were prepared to fight because of their Ramadan attack plot.

Over the past week, the fighters have shown their muscle, withstanding a sustained assault by the Philippine military and increasing fears that the Islamic State group's violent ideology is gaining a foothold in this country's restive southern islands, where a Muslim separatist rebellion has raged for decades.

President Rodrigo Duterte declared martial law in the south through mid-July.

The army insists the drawn-out fight is not a true sign of the militants' strength, and that the military has held back to spare civilians' lives.

As of Tuesday morning, Ano said the military, working house-by-house, had cleared 70 percent of the city and the remaining militants were isolated.

Still, the fighters have turned out to be remarkably well-armed and resilient.

In recent years, small militant groups in the Philippines, Indonesia and Malaysia have begun unifying under the banner of the Islamic State group. Jose Calida, the top Philippine prosecutor, said last week that the violence on the large southern island of Mindanao "is no longer a rebellion of Filipino citizens."

Three Malaysians, an Indonesian and possibly Arab extremists have been killed in the Marawi fighting, Ano said, citing the latest intelligence on the matter. He said Hapilon was still hiding somewhere in the city and that authorities were working to confirm another top militant had been killed.

At least 65 militants have been killed and 15 Philippine troops, Ano said. The bodies of 19 civilians have been recovered and local authorities have reported more civilian deaths still to be tallied.

Rohan Gunaratna, a terrorism expert at Singapore's S. Rarajatnam School of International Studies, said the fighting in Marawi, along with smaller battles elsewhere in the southern Philippines, may be precursors to declaring a province, which would be "a huge success for the terrorists."

Last week, two suicide bombings in Jakarta, Indonesia, killed three police officers, an attack claimed by IS. While Indonesia has been fighting local militants since 2002, the rise of the Islamic State group has breathed new life into those militant networks and raised concern about the risk of Indonesian fighters returning home from the Middle East.

Experts have warned that as IS is weakened in Syria and Iraq, battered by years of American-led attacks, Mindanao could become a focal point for regional fighters.

Southeast Asian fighters fleeing the Middle East "could look to Mindanao to provide temporary refuge as they work their way home," said a report late last year by the Jakarta-based Institute for Policy Analysis of Conflict, predicting a high risk of regional violence. Marawi is regarded as the heartland of the Islamic faith on Mindanao island.

Ano, the military chief, told The Associated Press on Tuesday that the extremists had plotted to set Marawi ablaze entirely to project IS's influence. The extremists wanted to kill Christians in nearby Iligan city on Ramadan, the Muslim holy month of fasting, to mimic the violence seen by the world in Syria and Iraq, Ano said.

The fighters' support network in Marawi remains unclear, though the power of one militant group — the Mautes — has grown in recent years. Led by members of the city's Maute clan, the group has become increasingly active in a number of towns across Lanao del Sur province, where Marawi is located, and has been instrumental in the fighting this past week.

Muslim rebels have been waging a separatist rebellion in the south of the predominantly Roman Catholic nation for decades. The largest armed group dropped its secessionist demands in 1996, when it signed a Muslim autonomy deal with the Philippine government. Amid continuing poverty and other social ills, restiveness among minority Muslims has continued.

Hapilon is an Islamic preacher and former commander of the Abu Sayyaf militant group who pledged allegiance to the Islamic State group in 2014. He now heads an alliance of at least 10 smaller militant groups, including the Maute.

Maute militants flew an IS flag in one of the city's mosques last year, a local resident said, speaking on condition of anonymity, fearing for his safety. He said they also pressured local Muslim preachers, accustomed to a less-strict form of Islam, not to speak out against them.

But Acmad Aliponto, a 56-year-old court sheriff who decided not to flee the city, said that while the militants were well-armed, he believes they have little local support, and that the recent violence could turn more people against them.

"In the end their relatives and everyday people may be the ones who will kill them," he said. "Look at what they did. So many were affected."