Philippine President Rodrigo Duterte on Tuesday personally apologised to the residents of Marawi who were displaced during the close to-one month military operations in the southern city and for the declaration of martial law in the whole Mindanao, following attacks by Islamic militants, China's Xinhua news agency reported.

The president visited displaced families from Marawi who are currently staying at an evacuation center in Iligan City and led the distribution of financial and relief aid.

In the speech of the event, he said he had no choice but to impose martial law as the Islamic militants were already destroying the city and a lot of people are already being affected by the attacks.

Duterte, who claimed that his grandmother was a Maranao, a local tribe in Mindanao island, said he was hurt and angry that some Maranaos allowed the foreign terrorist ideology to enter the country.

"I would like to say to the Maranao people that I am very, very, very sorry that this happened to us. I hope in the near future, you will find a new heart to forgive my soldiers, the government, even me for declaring martial law," he said.

"I have no choice, they are destroying Marawi. I have to drive them out. But I am very sorry. Please extend my condolences to our Maranao siblings for this incident," he added.

The president on May 23 placed Mindanao under martial law for 60 days and suspended the writ of habeas corpus following attacks by the Maute-Abu Sayyaf Group which had pledged allegiance to the Islamic States.

Duterte said he also had to make the declaration to prevent civil war from developing, noting that some of those who are hurt and affected by the attacks are capable of arming themselves like some Christians.

Meanwhile, he urged everyone not to follow the foreign militant ideologies and to pray for an immediate resolution of the situation.

The fighting has so far resulted in the death of 258 Maute members, 65 soldiers and policemen and 26 civilians, according to Philippine military.

Duterte on Tuesday extended his condolences to the families of the soldiers who were killed in action and assured the families that the government would take care of them.

-- BERNAMA