Army tanks packed with soldiers have rolled into the southern Philippine city of Marawi after militants linked to Isis launched a violent siege, capturing Christians, torching buildings and setting free scores of prisoners. The Catholic church said militants were using Christians and a priest as human shields and had contacted cardinals with threats to execute hostages unless government troops withdrew.

President Rodrigo Duterte defended his decision to declare martial law on Mindanao, the Muslim-majority island where Marawi is located, to prevent the spread of extremism in the impoverished region.

Philippines: Marawi City

The violence flared in Marawi after a botched raid by security forces on a hideout of the Maute, a militant group that has pledged allegiance to Isis. Fighters quickly dispersed, torching buildings and taking over bridges, a hospital, two jails, a church and a college. Duterte said he heard reports they may have beheaded a police chief.

He said Isis must be repelled from the Christian-majority Philippines and he would use all means possible to crush the Maute group and the allied Abu Sayyaf, whatever the consequences.

"Anyone now holding a gun, confronting government with violence, my orders are spare no one, let us solve the problems of Mindanao once and for all," said Duterte, who is from the island, after cutting short a visit to Russia and returning to Manila. "If I think you should die, you will die. If you fight us, you will die. If there's an open defiance, you will die, and if it means many people dying, so be it. That's how it is."

Soldiers and guerrillas set up rival checkpoints and roadblocks on routes in and around Marawi as civilians fled the city of 200,000 in droves, leaving behind what one official described as a ghost town. Long queues of pickup trucks and jeeps crammed full of people and loaded with belongings crawled along roads into nearby towns as troops searched vehicles for weapons and bombs.

The military has not explained how the raid on an apartment hideout went so badly wrong. The operation was aimed at capturing Isnilon Hapilon, a leader of the Abu Sayyaf group notorious for piracy, banditry and for kidnapping and decapitating Westerners. The Maute and Abu Sayyaf have proved fierce opponents for the military.

The armed forces said they were on top of the situation but residents who fled told a different story. "The city is still under the control of the armed group. They are all over the main roads and two bridges leading to Marawi," student Rabani Mautum told Reuters in Pantar town, about 16 km (10 miles) away.