* Witnesses say rebels in control of city
* Duterte says martial law will be like Marcos era
* Says will restore law and order in Mindanao
* Activists say martial law unnecessary
Thousands of civilians fled fighting in the Philippines on Wednesday as troops sought to contain Islamic State-linked militants who took over large parts of a city, set building ablaze and took hostage a Catholic priest and other Christians.
President Rodrigo Duterte declared martial law on his native island of Mindanao following a failed raid by soldiers on Tuesday on a hideout of the Maute militant group, which triggered clashes and chaos across the largely Muslim city of Marawi.
Duterte has long threatened martial law to destroy the Maute group and the allied Abu Sayyaf, which he warns are trying to create an Islamic State presence in the Christian-majority Philippines. He says they must be stopped before it is too late.
He cut short a visit to Russia and warned there would be a tough response, likening the situation to the 1970s rule of late dictator Ferdinand Marcos, remembered by many Filipinos as one of the darkest chapters of their recent history.
Duterte said martial law under Marcos was "very good" and he might consider more security measures elsewhere in the Philippines.
"I was asked what would be my response to terrorism and I said I would be harsh and harsh in enforcing the law," Duterte told reporters upon arrival in Manila.
"I have always said do not force my hand into it because if I start to declare martial law I will solve all the problems of Mindanao connected with law and order."
Soldiers and rebels set up checkpoints and road blocks on routes out of Marawi and a stream of men, women and children fled from late on Tuesday and on Wednesday, cramming into jeeps loaded with belongings.
The military gave few details about the clashes nor did they say if any rebels had been killed. The military has not explained how the raid on an apartment hideout resulted in Maute gunmen going on the rampage and taking over roads, bridges and buildings.
Fighting abated on Wednesday as the military tried to isolate fighters while awaiting reinforcements. There was no update on the toll of three members of the security forces authorities reported killed and 12 people wounded.
The armed forces said the situation was under control but residents who fled told a different story and said Marawi was in the hands of the rebels, who had allowed civilians to leave.
"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 from Marawi.
"I was in school when we heard gunfire ... When we came out there were bloodstains in the building but we did not see dead or wounded."
Praying for hostages
The rebels took hostage Father Chito Suganob, a priest at the city's Cathedral of Our Lady Help of Christians, and several other Christians, according to the head of the country bishops' association.
"They have threatened to kill the hostages if the government forces unleashed against them are not recalled," said Father Socrates Villegas, president of Catholic Bishops Conference of the Philippines.
"We beg every Filipino to pray fervently for Father Chito and for other hostages."
Critics chided Duterte for what they saw as an overreaction in declaring martial law for two months on the southern island, which is the size of South Korea and the second biggest in the Philippines, after an incident in one city.
The National Union of Peoples' Lawyers, a group of human rights attorneys, said the decision was "a sledgehammer, knee-jerk reaction" that would "open the flood gates for unbridled human rights violations and abuses".
Tuesday's raid was aimed at capturing Isnilon Hapilon, a leader of the Abu Sayyaf group notorious for piracy, banditry and for kidnapping and beheading Westerners. He is wanted by the United States.
The Maute and Abu Sayyaf have pledged allegiance to Islamic State, and have proved fierce opponents for the military.
Duterte has warned repeatedly that Mindanao, an impoverished region beset by decades of unrest by separatist and Marxist guerrillas, was at risk of "contamination" by Islamic State fighters driven out of Iraq and Syria.
Armed forces spokesman Edgard Arevalo urged the public not to be alarmed and said the Maute group was showing off to Islamic State.
"They are merely courting the acclamation of ISIS which until now they haven't received."