"If I think that the ISIS has already taken foothold also in Luzon and terrorism is not really far behind, I might declare martial law throughout the country to protect the people," said the President, at a news conference in Manila, Wednesday.
"I had to declare martial law in the Mindanao group of islands," said Duterte, who cut short a visit to Russia to come home to deal with the violence. "It is our constitutional duty to enforce the law and provide security."
The current martial law order -- which covers both the city of Marawi and the wider island of Mindanao, of which Marawi is a part -- came after deadly clashes broke out between Filipino government troops and Islamist militants Tuesday.
Fighting between government forces and the Maute group, an Islamist militant organization based in Mindanao, began Tuesday afternoon in Marawi, a city of about 200,000 people.
ISIS' media wing, Amaq Agency, put out a statement announcing that "fighters of the Islamic State launch a wide-scale offensive on positions of Philippine troops in the city of Marawi."
Presidential spokesman Ernesto Abella confirmed that the fighters had taken over several government buildings in the city, and had torched others, including a church, a school and the city jail. It was not clear from his statement how damaged the buildings were by the arson.
Mindanao is home to a sizable Muslim population, in contrast to the remainder of the country, which is overwhelmingly Catholic.
The militants also reportedly took over a medical center and replaced the Philippines flag with a black, ISIS-style banner.
Armed Forces of the Philippines (AFP) spokesman Lt. Col. Jo-Ar Herrera said that Isnilon Hapilon, the leader of the Abu Sayyaf Group, which has pledged allegiance to ISIS, was among the armed men.
Three government troops died in the fighting, said Abella, and 12 were injured. Martial law was declared about 10 p.m. Tuesday, and reinforcements were expected.
"Our operation is still ongoing in Marawi City and sporadic fighting is still continuing," a statement from the Armed Forces of the Philippines said.
"The joint AFP-PNP team that is after Isnilon Hapilon and his cohorts is determined to finish him off," the statement said.
Residents were sheltering in their houses overnight, Abella said. But CNN Philippines reported that many residents were evacuating Marawi City because of the fighting and that traffic jams were occurring along the main roads.
The Catholic Bishops' Conference of the Philippines (CBCP) confirmed that a priest in Marawi City has been taken hostage, reported CNN Philippines.
Members of the Maute terror group forced their way into a cathedral and took Father Teresito "Chito" Suganob, along with a few others, CBCP president Archbishop Socrates Villegas said Wednesday.
Russian weapons to fight Philippines militants
The violence prompted Duterte to cut short a visit to Moscow, during which one of his top priorities was to
acquire Russian-made precision armaments to use against the militants in the Southern Philippines. It's highly unusual for a US ally to purchase arms from Russia, an adversary, though Duterte said in October
he planned to "break up" with the United States and turn to Russia and China.
Kremlin spokesman Dmitry Peskov said Duterte's visit was a step toward developing the Philippines' bilateral relationship with Russia, rather than any move toward a Filipino-Russian-Chinese alliance.
"Russia is not building any secret alliances," Peskov said Wednesday in conference call with reporters, when CNN asked him about Duterte's October statement. "It's very consistent in developing relations with other countries on (a) mutually beneficial basis and on the basis of mutual respect."
Speaking from Moscow, Philippines Foreign Secretary Alan Peter Cayetano said that the violence in Mindanao, one of the Philippines' southernmost islands, was Duterte's priority, despite the high-profile visit to Moscow and St. Petersburg.
"(The Russians) understand that the security of the Filipino people, especially in Marawi and in Mindanao, is a priority," Cayetano said. "I will be staying behind. The agreements will be signed."
Extended martial law
Martial law will be in effect on the Muslim-majority southern Philippines island for 60 days "to suppress lawless violence and rebellion and for public safety," said Abella, according to the Philippine News Agency.
Under the 1987 constitution, the president has the ability to place the country under martial law, though Congress has the ability to revoke the proclamation. The period should not last more than two months
However, Duterte says martial law in the southern Philippines could last a year.
"If it would take a year to do it, then we'll do it. If it's over within a month, then I'd be happy," Duterte said in a video posted on Facebook by Mocha Uson, the assistant secretary to the Presidential Communications Operation Office.
A group of Muslim attorneys said they planned to challenge the imposition of martial law in court, CNN Philippines reported.
The country suffered 14 years of martial law under former dictator Ferdinand Marcos, who was ousted in a peaceful revolution in 1986. The possibility of martial law being extended throughout the country has stoked fears among some Filipinos of a repeat of that period.
During the 14 years, perceived opponents of Marcos were subjected to numerous human rights violations, including imprisonment, forced disappearances and torture. Extrajudicial killings carried out by Marcos' secret police were also common.
Many young Filipinos have little or no knowledge of the period under Marcos, and of life under martial law.
Duterte though appeared unruffled by the comparison, even seeking to embrace it. "It would not be any different from what President Marcos did," said Duterte in his video message, referring to the current martial law ruling. "I'd be harsh."
Attacks grow in intensity
Authorities have accused the Maute
of involvement in a bombing in Duterte's hometown of Davao in September that left 14 people dead.
Terrorism has been a persistent problem in the southern Philippines, where Maute and Abu Sayyaf are based.
Groups pledging support or allegiance to ISIS have emerged in the Philippines over the last three years and have received growing attention from ISIS media outlets.
In April last year, ISIS announced it was appointing Sheikh Abu Abdullah al-Filipini as its emir in the Philippines.
Abdullah was a leader of the Abu Sayyaf group and brought with him hundreds of fighters. Elements of the Moro Islamic Liberation Front also pledged their allegiance to Abu Bakr al-Baghdadi last year, releasing videos of jungle training camps and the executions of alleged Filipino spies.
Attacks carried out by ISIS-affiliated groups have since grown in scale and audacity.
Jihadists claimed their first attack on Marawi nearly a year ago. There have also been assassinations of military personnel in the southern Philippines. But the complex attack on Marawi this week is the most ambitious yet.
There is some evidence that foreign fighters have joined these groups, including a Moroccan bomb-maker who was killed last year and a number of Bangladeshi nationals.