"It would not be any different from what President [Ferdinand] Marcos did," declared Philippine President Rodrigo Duterte shortly after declaring martial law across the restive island of Mindanao. "I'd be harsh," he warned.

The tough-talking Filipino president was on a five-day trip to Moscow, when news broke out that the Maute, an armed group affiliated with the Islamic State of Iraq and the Levant (ISIL, also known as ISIS), laid siege to the city of Marawi, the biggest urban centre in the Muslim-majority provinces of the Philippines.

At first, the Philippine military tried to play down the situation by claiming that everything was under control. Yet, as hours went by, it became increasingly clear that the armed group was far from subdued, as it was still rampaging across the city, taking a Christian priest and several civilians hostage, and vowing to declare an Islamic State "Wilayat" (province) in Mindanao.

It will likely take weeks, if not months, before the Philippine government takes control of the situation since the ongoing violence has already forced thousands to flee Marawi to seek refuge elsewhere.

The whole episode rekindled horrific memories of the bloody clashes in Zamboanga city in 2013, when a splinter faction of the Moro National Liberation Front, reportedly led by leading Moro ideologue Nur Misuari, tried to lay siege on the Christian-majority city.

READ MORE: 'Foreigners fighting' with ISIL-linked Philippine group

The prosperous port city of Zamboanga was torn asunder by weeks-long clashes between the rebels and the Philippine military, which repeatedly pounded enemy positions from both the sky and the ground. Despite the military's efforts, the rebels initially managed to occupy several neighbourhoods, take control of government buildings, and take hundreds of civilians hostage.

Duterte, the first Filipino president from Mindanao, faces a similar, if not more menacing, conundrum in Marawi, as public pressure mounts on the government to address the growing threat posed by extremist groups that have wrecked havoc across the island for decades.

A City on Fire

The attacks by the Maute group, also known as the Islamic State of Lanao, were likely an opportunistic revenge operation. A few days earlier, the Philippine military staged a failed raid on a safe house in a bid to capture Isnilon Hapilon, the leader of the more known Abu Sayyaf group, which is also affiliated with ISIL. Hapilon is on the FBI's most wanted list and is largely seen as a prospective leader of a proposed "Caliphate" in Southeast Asia.

The extremists were likely also emboldened by the fact that not only the president, but also his key cabinet members, including National Security Adviser Hermogenes Esperon, were in Moscow to secure a series of defence and trade deals.

Perturbed by the scale and audacity of the attack, Duterte, who cut his Russia trip short, immediately declared all-out martial law across Mindanao. The Philippines' 1987 constitution allows Filipino leaders to declare it only when there is a "rebellion and invasion".

Most likely the decision to declare martial law was based on an intelligence report suggesting that ISIL- affiliate groups were planning coordinated attacks across the whole region. Government officials cited the troubling presence of foreign fighters among Maute elements as an evidence of "invasion", a term that usually applies to full-scale military assault by an invading foreign army.

Road to Perdition

Far from signifying strength, Duterte's threat reflects the inability of the government to pre-empt and effectively address the conflict in Mindanao, which has provided a hospitable environment for extremist ideology and mobilisation.

Upon his hasty return, Duterte upped the ante by suggesting he may place, if needed, the entire country under martial law to "protect and preserve the Filipino nation". The announcement provoked a flurry of criticisms, including from leading legislators, who argued that a nationwide Martial Law is a step too far.

Others wondered why Duterte didn't resort to milder constitutional measures, such as declaring a state of lawlessness or emergency, which would have still allowed him to effectively mobilise the military with maximum legal leeway.

Nonetheless, there are multiple built-in safeguards in the Philippine constitution against abuse of executive power. First of all, to implement martial law, the president will have to immediately get the approval of the Philippine Congress. Also, the Supreme Court has the mandate to nullify any martial law declaration, if deemed unjustified, within the first 60 days of implementation.

Duterte's allies in the legislature will be happy to get through the martial law declaration in Mindanao, but extending emergency measures across the country will likely face stiff opposition.

Reassuringly, the Philippine military, which has the task of protecting the Constitution, sought to assuage fears of a renewed Marcosian dictatorship by immediately releasing a set of guidelines, which safeguard basic political rights and civil liberties of citizens.

Far from signifying strength, Duterte's threat reflects the inability of the government to pre-empt and effectively address the conflict in Mindanao, which has provided a hospitable environment for extremist ideology and mobilisation.

OPINION: Peace is still possible in Duterte's Philippines

Throughout his first year in office, the Filipino leader obsessively pursued a brutal campaign against illegal drugs, which has come under heavy criticism by Western countries and human rights groups. Duterte also prioritised peace negotiations with communist rebels over talks with the much more powerful Islamist insurgents, particularly the Moro Islamic Liberation Front.

After months of strategic flirtation with China and Russia, Duterte will now have to seek support from tried and tested allies such as the United States, which possesses high-grade intelligence, defence equipment and been a partner in counterterror operations throughout decades.

Duterte may also have to revisit his earlier threat to reject, in light of disagreement on human rights issues, grants from the European Union, which has heavily invested in the Mindanao peace process.

All of a sudden, the Philippines is grappling with the spectre of ISIL and, for some, Marcosian authoritarianism.

Richard Javad Heydarian is a specialist in Asian geopolitical/economic affairs and author of Asia's New Battlefield: The USA, China, and the Struggle for the Western Pacific.

The views expressed in this article are the author's own and do not necessarily reflect Al Jazeera's editorial policy.