Philippine President Rodrigo Duterte declared a southern city “liberated from terrorist influence” a day after government troops killed two top commanders of an armed alliance linked to ISIL.

Duterte made the announcement on Tuesday despite a military general saying dozens of fighters, including foreign nationals, were still battling Philippine troops in Marawi.

“I hereby declare Marawi city liberated from the terrorist influence. That marks the beginning of rehabilitation,” he said during a visit to the city.

Padilla said between 20 to 30 fighters, who he referred to as “stragglers”, remain. It is believed they are holding at least 20 hostages.

Reports said a Malaysian doctor, Mahmud Ahmad – identified as a financial backer of the group – was also on the run.

Al Jazeera correspondent Jamela Alindogan, reporting from Marawi, confirmed there were still “pockets of fighting” in the beleaguered city.

On Monday, Isnilon Hapilon – top commander of the Abu Sayyaf group – and Omarkhayam Maute of the Maute group, as well as seven of their fighters, were killedduring a major assault on their hideout.

During that operation about 17 hostages were also reportedly rescued by the military.

Both Abu Sayyaf and Maute had declared allegiance to the Islamic State of Iraq and the Levant (ISIL, also known as ISIS), later joining forces to rampage through the university town in Mindanao.

The five-month battle of Marawi has killed more than 1,000 people and displaced as many as 600,000 while levelling the historic city.