Philippine military airstrikes aimed at Islamist militants who are battling soldiers in a southern city instead killed 10 troops and injured seven others, the defence secretary said on Thursday.
The friendly fire deaths bring to 171 the number of people reported killed since gunmen waving black flags of the Islamic State (IS) group began rampaging through the Muslim city of Marawi last week.
Shortly after the violence erupted President Rodrigo Duterte imposed martial law across the southern region of Mindanao, home to 20 million people, to quell what he said was an IS bid to establish a base in the mainly Catholic Philippines.
But the government's narrative of being in "full control" of Marawi took a hit Thursday when defence chiefs said 11 soldiers were killed in a misguided bombing mission.
"It's very painful. It's very sad to be hitting our own troops," Defence Secretary Delfin Lorenzana told reporters in Manila.
"It's sad but sometimes it happens in the fog of war."
He initially said 10 soldiers died but national military spokesman Brigadier-General Restituto Padilla later confirmed 11 were killed.
Lorenzana also warned that many militants may have escaped, despite checkpoints throughout the city and surrounding it.
"We have reports they are going to some of the towns around Marawi city," Lorenzana said.
He said there were about 500 militants at the start of the unrest and only between 50 and 100 were believed to still be in Marawi. According to the military, 120 gunmen have been killed, meaning as many as 330 remain unaccounted for and could have slipped out of the city.
Adding to concerns about the rising threat of IS, Lorenzana said militants from Saudi Arabia, Chechnya, Yemen, Malaysia and Indonesia were among the dead.
The military has relentlessly dropped bombs and fired rockets at the militants, who have been hiding in residential areas of Marawi where local authorities believe about 2,000 people are trapped.
The gunmen are also holding hostages, some of whom have been forced to speak on propaganda videos for the militants calling for troops to withdraw.
Local authorities have repeatedly warned that the trapped residents and hostages are in grave danger of being killed in the air assaults, and on Thursday repeated calls for them to end.
"We continuously appeal to the chain of command... to refrain from using airstrikes," Zia Alonto Adiong, a local politician and spokesman for the provincial crisis management committee, told reporters in Marawi.
The International Committee of the Red Cross on Wednesday called for a humanitarian ceasefire.
Lorenzana said airstrikes may be curtailed because of the friendly fire incident, but military spokesman Padilla insisted the soldiers' deaths would not weaken the resolve of the armed forces.
"We will be unrelenting in the pursuit of our mission. The drive, resolve of every AFP (Armed Forces of the Philippines) personnel in the air, ground and water remain undiminished," Padilla told reporters.
"We will incessantly push our way forward to retake the remaining part of Marawi and liberate the people that the terrorists continue to use as human shields."
The militants have murdered 19 civilians, the military has said, while insisting none have died in any air assaults or the intense street-to-street battles.
Thirty-two soldiers and police officers have been confirmed killed.
The clashes erupted when security forces raided a house to arrest Isnilon Hapilon, a veteran Filipino militant regarded as IS's leader in the Philippines. He is on the US government's list of most-wanted terrorists.
The militants mostly belonged to a local group called the Maute, and the infamous Abu Sayyaf kidnap-for-ransom gang that Hapilon has helped lead for many years.
A Muslim separatist rebellion in the southern Philippines has killed more than 120,000 people since the 1970s.
The main Muslim rebel groups have signed accords with the government aimed at forging lasting peace, giving up their separatist ambitions in return for autonomy.
The Maute, the Abu Sayyaf and other hardline groups have rejected the peace process.