Some 13 marines have been killed in fierce fighting with Muslim militants who have laid siege to a Philippines city for nearly a month.

It is the biggest loss for government forces in a single day, the military said.

The marines were conducting a house-to-house search for militants allied with Islamic State (IS) who are still occupying parts of Marawi when the battle erupted on Friday, said Lieutenant Colonel Jo-ar Herrera.

The spokesman for the army's 1st Infantry Division said that about 30 to 40 militants used civilians as human shields and positioned themselves in the city's many mosques.

Forty other marines were wounded, he said.

The government earlier said the unrest had left 20 civilians, 134 militants and 39 government troops dead.

Hundreds of thousands of people have fled the city, parts of which were reduced to rubble by fighting and government air strikes in an attempt to dislodge the rebels.

"This temporary setback has not diminished our resolve a bit," said military spokesman Colonel Edgard Arevalo.

"It instead primed up our determination to continue our prudent advances to neutralise the enemy, save the innocent lives trapped in the fight, and set the conditions for the rehabilitation and reconstruction of Marawi."

Philippine president Rodrigo Duterte has declared martial law in the Mindanao region, the southern third of the Philippines and home to a decades-long Muslim separatist rebellion.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.