Military rule in southern Philippines came into effect in May 2017 following the attack and siege in the city of Marawi.

Philippine President Rodrigo Duterte will lift martial law in Mindanao by the end of the year, his spokesperson has announced, signalling an end to the controversial May 2017 order that placed the entire southern island under military control.

“The Office of the President wishes to announce that President Rodrigo Roa Duterte will not extend martial law in Mindanao upon its expiration on December 31, 2019,” Salvador Panelo said in a statement on Tuesday.

Panelo told reporters in the Philippine capital Manila that the decision was made based on the advice of security and military officials.

On December 4, Defense Secretary Delfin Lorenzana said in a media forum that he had recommended the presidential order be lifted.

Duterte declared martial law in Mindanao on May 23, 2017, after hundreds of fighters from the Maute and Abu Sayyaf armed groups laid siege to the southern city of Marawi.

The order, which was to last only for 60 days, was extended until the end of 2017 and subsequently renewed until the end of 2018, then the end of 2019, with the government citing continued security concerns.

The declaration and its extensions were approved by the Philippine Congress, which is dominated by Duterte’s allies.

While the fighting was confined to Marawi, Duterte’s order covered the entire island of Mindanao, which is home to about 20 million people.

Critics have questioned the legality of Duterte’s order but the Supreme Court denied a legal challenge to it, saying it was necessary to quell the armed rebellion, which lasted for five months.

The battle for Marawi killed more than 1,000 people and displaced as many as 600,000 while levelling the historic city. The siege ended on October 2017.

Despite martial law, critics said Duterte failed to stop armed attacks in the south, which included the bombing of a Roman Catholic Church in Jolo, Sulu, that left at least 20 people dead in January 2019.

On Tuesday, Panelo, the presidential spokesperson, said that even with the lifting of the martial law, the people of Mindanao “are assured that any incipient major threat in the region would be nipped in the bud.”

In an interview with Al Jazeera, Marawi community leader Drieza Abato Lininding said he welcomes Duterte’s decision.

“It’s long overdue but a welcome development. We’ve been consistent in our appeals in the past that the martial law is not necessary in the fight against extremist groups.”

Lininding also urged the government to lift curfews imposed in Marawi and the province of Lanao del Sur, “to ensure freedom of movement and maximise it for economic activities for recovery.”