Displaced residents rest at an evacuation center in Saguiaran township, Lanao Del Sur province in southern Philippines Friday, June 23, 2017. Tens of thousands of residents are now housed in different evacuation centers as Government troops fight with Muslim militants who laid siege to Marawi city a month ago. (AP Photo/Linus Guardian Escandor II)

Displaced residents rest at an evacuation center in Saguiaran township, Lanao Del Sur province in southern Philippines Friday, June 23, 2017. Tens of thousands of residents are now housed in different evacuation centers as Government troops fight with Muslim militants who laid siege to Marawi city a month ago. (AP Photo/Linus Guardian Escandor II)

MANILA, Philippines (AP) — The Philippine military on Sunday began observing an eight-hour halt in its air and ground offensive against Islamic militants in southern Marawi city to allow residents, most of them displaced by the monthlong fighting, to celebrate the end of the Muslim fasting month of Ramadan.

Military spokesman Brig. Gen. Restituto Padilla said the “humanitarian pause” in military assaults took effect at 6 a.m. Sunday in predominantly Muslim Marawi but will be lifted immediately if the militants open fire or threaten troops and civilians.

ADVERTISEMENT

“If the enemy starts firing ... anyone can exercise their right to self-defense,” Padilla said in a statement.

It’s the first planned respite in the massive offensive after a month of daily street battles and military airstrikes that have left at least 280 militants, 69 soldiers and police, and 26 civilians dead. The intense fighting has turned large swaths of the mosque-dotted city, a bastion of Islamic faith in the south of the largely Roman Catholic nation, into a smoldering war zone.

About 500 gunmen aligned with the Islamic State group, including several foreigners, stormed the lakeside city of 200,000 people, occupied buildings, burned schools and hoisted IS-style black flags on May 23.

Faced by his worst crisis, President Rodrigo Duterte responded by declaring martial law in the south and ordering a massive offensive.

Padilla said the cease-fire will be observed by the military “as a gesture of our strong commitment and respect to the Muslim world,” particularly to Marawi’s Muslim residents.

The fighting has forced more than 300,000 people to abandon their homes in Marawi and outlying towns and flee to evacuation centers, which rapidly became overcrowded, making it difficult for them to celebrate the Eid el-Fitr holiday.