The Philippine military declared an eight-hour ceasefire Sunday in its offensive against Islamist militants occupying parts of the war-torn city of Marawi, to allow residents to celebrate the end of Ramadan.

Assaults backed by air and artillery bombardment stopped at the start of Islamic prayers at 6am but gunfire erupted as soon as the truce ended around 2pm, AFP reporters in Marawi said.

Military chief General Eduardo Ano ordered his forces to observe a "humanitarian pause" during the Eid al-Fitr holiday in Marawi, the most important Muslim city in the mainly Catholic Philippines.

"We declare a lull in our current operations in the city on that day as a manifestation of our high respect to the Islamic faith," Ano said in a statement.

The Eid al-Fitr festival ends the fasting month of Ramadan.

Hundreds of militants, flying the flag of the Islamic State group and backed by foreign fighters, seized swathes of Marawi in the southern region of Mindanao last month, sparking bloody street battles and raising regional concern.

Residents who fled the conflict in Marawi pray during Eid al-Fitr on the grounds of the city hall in Iligan City on the southern island of Mindanao

(PA/AFP)

Troops have launched a relentless air and ground offensive but have failed to dislodge gunmen from entrenched positions in pockets of the city.

Much of the lakeside city is now in ruins while most of its 200,000 residents have fled to evacuation centres or to the homes of relatives and friends in other towns.

At Iligan just north of Marawi, evacuees dressed in colourful flowing robes marked the end of Ramadan by holding prayers on the grounds of city hall.

Armed commandos from the police Special Action force stood guard as the prayers were held.

Presidential spokesman Ernesto Abella said Sunday a Philippine Navy ship was sent to Cotabato south of Marawi to bring supplies for soldiers involved in the fighting and serve as a floating hospital for the wounded.

Civilians trapped

Military spokesman Brigadier General Restituto Padilla said around 500 civilians remained trapped in areas where the fighting is concentrated.

After the ceasefire ends "we will continue to try to enter the areas occupied by them and liberate Marawi", Padilla said on radio station DZBB.