ILIGAN CITY, Philippines (Reuters) - Philippine President Rodrigo Duterte appealed to Islamist militants on Friday to abandon hostilities and start dialogue in an effort to end their bloody occupation of a southern city that experts called a major blow to regional security.
Duterte said the presence of foreign fighters in street battles that have raged since Tuesday in Marawi City was proof that Islamic State had gained a foothold on the restive island of Mindanao, but there was still a chance for peace.
"You can say that the ISIS is here already," Duterte told soldiers in nearby Iligan City, referring to Islamic State.
"My message mainly to the terrorists on the other side is we can still solve this through dialogue. And if you cannot be convinced to stop fighting, so be it. Let's just fight."
Special forces commandoes were deployed to drive out the remaining 20 to 30 Maute group rebels holed-up in Marawi but encountered heavy resistance on Friday. The army said 11 soldiers and 31 militants have been killed.
Fighting erupted on Tuesday after a bungled raid by security forces on a Maute hideout, which spiralled into chaos, with gunmen seizing bridges, roads and buildings and taking Christians hostage. Duterte responded by declaring martial law throughout his home island of Mindanao.
Rohan Gunaratna, a Singapore-based security expert, said the siege was a wake-up call for the Philippines.
"Islamic State capturing a major city in the Philippines is a very significant blow to the security and stability of this region," he said.
"The Filipinos need to get their act together ... They must understand the truth that IS ideology took hold in their country. The local groups have transformed."
Malaysians, Indonesians and other foreigners were among the guerrillas killed on Thursday, which the government said demonstrated how the Philippines could become a haven for overseas militants.
The White House on Thursday said it backed the Philippine fight against "cowardly terrorists".
Duterte has warned of "contamination" by Islamic State, exploiting the poverty, lawlessness and porous borders of predominantly Muslim areas of Mindanao island to establish a base for radicals from Southeast Asia and beyond.
He has pleaded with political and Islamic leaders to keep foreign and local militants at bay. Months of air and ground offensives in Mindanao have not dented their resolve.
"What's happening in Mindanao is no longer a rebellion of Filipino citizens," Solicitor General Jose Calida told reporters in explaining why martial law was imposed.
"It has transmogrified into invasion by foreign terrorists, who heeded the call of the ISIS to go to the Philippines if they find difficulty in going to Iraq and Syria."
Most of Marawi's 200,000 inhabitants fled after the gunmen ran amok on Tuesday, seizing and torching buildings, freeing militants from jails and taking a priest and churchgoers hostage at the city's cathedral.Duterte has dealt with separatist unrest during his 22 years as a mayor in Mindanao but the Maute's rise and signs that it has ties to another group, the Abu Sayyaf, present one of the biggest challenges of a presidency won on promises to fight drugs and lawlessness.
Philippine intelligence indicates the two groups from different parts of Mindanao are connected, through Isnilon Hapilon, a leader of a radical faction of Abu Sayyaf.
Abu Sayyaf has a track record of banditry, piracy and violence, while the lesser-known Maute group has proven itself a fierce battlefield opponent for the military, able to sustain air and artillery bombardments and regroup after heavy losses.
Hapilon was the target of Tuesday's botched raid and Duterte said Islamic State in the Middle East had anointed him as its man in the Philippines, and Hapilon was revered as its leader.
Military chief General Eduardo Ano said the fierce resistance by the Maute in Marawi was to protect Hapilon, who was in poor condition after being wounded in a January air strike.
"If we capture him, all the better. But if he fights back we have to do what is necessary," he told reporters.
Convoys of vehicles packed with evacuees and protected by soldiers streamed into Iligan. Mark Angelou Siega, a Christian, described how students fled their campus.
"We were so scared and so were our Muslim brothers and sisters. We were sure they would get to us," he said.
"These terrorists are not real Muslims."
Calida said the Maute group and Islamic State were radicalising young Muslims and the government was not the only target of their aggression.
"People they consider as infidels, whether Christians or Muslims, are also targets," he said.
For a graphic on Islamic State-linked groups in the Philippie south click - tmsnrt.rs/2rYIHTj
(This version of the story corrects references to Mindanao being native island of Duterte and predominantly Muslim, in paragraphs six and 12)
Additional reporting by Neil Jerome Morales in DAVAO CITY, Kanupriya Kapoor in SINGAPORE, Romeo Ranoco in MARAWI CITY and Enrico dela Cruz and Manolo Serapio Jr in MANILA; Writing by Martin Petty; Editing Robert Birsel