U.S. special forces have joined the battle to crush Islamist militants holed up in a southern Philippine town, officials said on Saturday, as government forces struggled to make headway and 13 marines were killed in intense urban fighting.

The Philippine military said the United States was providing technical assistance to end the siege of Marawi by fighters allied to the Islamic State group, which is now in its third week, but it had no boots on the ground.

"They are not fighting. They are just providing technical support," military spokesman Lt. Col. Jo-Ar Herrera told a news conference in Marawi.