Philippines troops backed by tanks and helicopters battled on Friday to retake Marawi, the southern city of 200,000 people which was overrun by militants linked to the so-called "Islamic State" (IS) earlier this week. Tens of thousands of residents have fled the city.

Philippine President Rodrigo Duterte called on the militants to abandon hostilities and start a dialogue. "My message mainly to the terrorists on the other side is we can still solve this through dialogue," Duterte said on Friday. "And if you cannot be convinced to stop fighting, so be it. Let's just fight."

Smoke rises after military helicopters fired rockets on Marawi

Military spokesman Brigadier General Restituto Padilla told reporters on Friday that the press and social media would be controlled "One, to ensure the safety of lives, second to ensure operational security and ensure the safety of our men in uniform who are fighting, and for other national security considerations," he said.

At least 31 militants from a group called Maute and 11 soldiers have been killed in heavy fighting that has caused thousands of civilians to flee Marawi, the army said.

It is unknown how many civilians have been killed, but a priest and his worshippers have been taken hostage amid reports the militants are using civilians as human shields and executing people.

The fighting began when police and soldiers on Tuesday raided an apartment in Marawi where Isnilon Hapilon, the leader of the notorious Abu Sayyaf group and the Philippine head of IS, was suspected of hiding. Hapilon also leads an umbrella of smaller militant groups, including the Maute.

Soldiers in February distribute wanted flyers for Isnilon Hapilon, who has a US government $5-million (4.45-million-euro) bounty for his capture.

The raid quickly went wrong after Maute militants called in reinforcements and overran government forces. The militants sealed off parts of the city, raised the IS black flag and torched buildings, including churches and schools.

In response, President Rodrigo Duterte imposed 60 days of martial law on Tuesday across Mindanao, the country's second largest island and home to an impoverished Muslim minority.

Read: Duterte's real motives behind declaring martial law

Military vehicles move between vehicles of residents fleeing Marawi.

Foreign fighters

The southern Philippines has long faced Islamist insurgencies, but Duterte has warned IS seeks to spread its influence and ideology.

In explaining why martial law was imposed, Solicitor General Jose Calida said "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."

Authorities said foreign fighters from Malaysia, Indonesia and other nationalities were among the six foreigners killed on Thursday, raising concern over the wider influence of transnational jihad on the island.

"Before it was just a local terrorist group. But now they have subscribed to the ideology of ISIS (Islamic State)," Calida told a news conference. "They want to make Mindanao part of the caliphate."

"People they consider as infidels, whether Christians or Muslims, are also targets of opportunity," he said. "What is worrisome is that the ISIS has radicalized a number of Filipino Muslim youth."

Watch video 00:30 Hundreds flee fighting in southern Philippines

cw/jm (AP, dpa, Reuters)