Updated

Foreign fighters are among the militants linked to the Islamic State group who are battling government troops in the southern Philippines, an official said Friday.

Solicitor General Jose Calida said Indonesians and Malaysians are fighting alongside the gunmen who attacked Marawi, a city of some 200,000 people on Mindanao island.

"What is happening in Mindanao is no longer a rebellion of Filipino citizens," Calida told reporters. "It has transmogrified into an invasion by foreign terrorists who heeded the clarion call of ISIS."

Philippine troops backed by armored vehicles and rocket-firing helicopters are fighting to re-take control of Marawi, which has been under siege by gunmen linked to the IS group since a raid earlier this week failed to capture one of Asia's most-wanted militants.

Rebels have torn through the streets of Marawi since Tuesday night, torching buildings, taking a priest and his worshippers hostage and sealing off much of the city. The violence forced thousands to flee and raised fears of growing extremism in the country.

At least 44 people have died in the fighting, including 31 militants and 11 soldiers, officials said Thursday. It was not immediately clear whether civilians were among the dead.

In a sign of the confusion over events inside the city, a local police chief told The Associated Press on Friday that he was alive and well — two days after President Rodrigo Duterte told the media he had been beheaded by militants.

Police Chief Romeo Enriquez said there may have been confusion because his predecessor in Malabang, a town near Marawi, was killed in the fighting on Tuesday, although he was not beheaded.

As authorities worked to clear the city, residents spoke of their terror.

"At night we can hear the gunfire," said Mohammad Usman, who watched from his home just outside Marawi as thousands of residents streamed out of the city Thursday. "I'm just praying that the bullets will not find their way to my house and hit us. I hope that the bombs will not land nearby and harm us."

Duterte imposed 60 days of martial law Tuesday on the island of Mindanao, a traditional homeland of minority Muslims that encompasses the southern third of the nation and is home to 22 million people. Marawi has a population of around 200,000.

Duterte warned he may expand martial law nationwide, an unnerving development for many in the Philippines who lived through the rule of late dictator Ferdinand Marcos. Marcos declared martial law in 1972 and used it to maintain his grip on power for more than a decade.

The man at the center of the Marawi violence is Isnilon Hapilon, an Arabic-speaking Islamic preacher known for his expertise in commando assaults. He is at the nexus of several militant groups that are trying to merge into a more powerful force.

Hapilon, who is a commander of the Abu Sayyaf militant group, pledged allegiance to the Islamic State group in 2014. He also heads an alliance that includes at least 10 smaller militant groups, including the Maute, which have a heavy presence in Marawi and were instrumental in fighting off government forces in this week's battles.

All these groups are inspired by the Islamic State group, but so far there is no sign of significant, material ties.

"We have not seen any concrete evidence of material support from IS," military spokesman Brig. Gen. Restituto Padilla said Thursday. But he added that the smaller groups "are working to really get that recognition and funds, of course."

Washington has offered a $5 million reward for information leading to Hapilon's capture, but he has proved elusive. The Philippines launched an airstrike that wounded him in January, but he got away.

The army raided what it believed to be his hideout on Tuesday night in Marawi, but the operation quickly went wrong. Militants called in reinforcements and were able to overpower government forces. Once again, Hapilon escaped. The military said it believes Hapilon was still in Marawi.

Much of Marawi was still a no-go zone. Automatic gunfire and explosions could be heard clearly and plumes of black smoke rose from the direction of the city center. Air force helicopters swooped overhead.

As authorities tried to gain more control over the city, disturbing details have emerged.

Militants forced their way into the Marawi Cathedral and seized a Catholic priest, 10 worshippers and three church workers, according to the city's bishop, Edwin de la Pena. The black flags of the Islamic State group were planted atop buildings and flown from commandeered vehicles, including a government ambulance and an armored car, said Mamintal Alonto Adiong Jr., vice governor of Lanao del Sur province, of which Marawi is the capital.

More than half of the population of Marawi has cleared out, Adiong said.

The problem of militancy in the south, the scene of decades-long Muslim separatist uprisings in the predominantly Catholic nation, is not new.

Duterte had repeatedly threatened to place the region under martial law, which allows him to use the armed forces to carry out arrests, searches and detentions more rapidly. But human rights groups and others fear that martial law powers could further embolden the president, who already has been accused of allowing extrajudicial killings of thousands of people in his crackdown on illegal drugs.

___

Cerojano reported from Manila.