MANILA (Update 6, 6:16 p.m.) — Officials said a military airstrike killed 11 soldiers and wounded seven others in "friendly fire" in city attacked by militants, as government forces struggled to rout the remaining Islamic extremists who laid a siege.

Military spokesman Brig. Gen. Restituto Padilla said Thursday a Marchetti SF-260 aircraft was on a bombing run over militant positions in Marawi City Wednesday when one bomb hit an army position locked in close-range combat with the extremists.

Defense Secretary Delfin Lorenzana said the military has ordered an investigation into the deaths of 10 soldiers, insisting on the figure lower than the 11 fatalities reported by the military spokesperson.

"There were two planes flying. The first plane dropped the ordnance accurately, the second went wrong and hit our troops," Lorenzana said at a news conference in Manila.

He said either those on the plane or those coordinating from the ground made a faulty call during the air operation.

Precision-guided bombs were used earlier in airstrikes in Marawi's urban areas, but the military ran out of the high-tech munitions and used conventional ones in Wednesday's bombing run, he said.

"It's painful, it's very sad to be hitting our own troops," Defense Secretary Delfin Lorenzana. "Sometimes, in the fog of war, a lot of things could happen."

The defense chief, appointed administrator of martial law in Mindanao, said he is leaving the decision to ground commanders on whether more airstrikes will be used in the operations.

"It was the first time the [armed forces] encountered such accident," Lorenzana said.

The reported casualties are the latest in the week-long clash between security forces and the Maute terror group that marched into the capital of Lanao del Sur province in Mindanao last week.

On Wednesday morning, Malacañang reported 21 state personnel were killed in action, while 72 were wounded in the ongoing battle.

The armed gunmen reportedly from the combined forces of the Abu Sayyaf and Maute groups also suffered casualties, with about 89 killed as of midday on Wednesday.

There were also 19 civilians reported to have perished in the hands of the militants as government said it has retaken about 90 percent of the city.

RELATED: With 90% of Marawi retaken, gov't vague about lifting martial law

The violence erupted last Tuesday after soldiers launched a raid to capture militant leader Isnilon Hapilon, who has been designated leader of the Islamic State group's Southeast Asia branch.

But the operation went awry and Hapilon got away. Fighters loyal to him surprised government forces with their firepower, fending off airstrikes and house-to-house searches.

The unrest has boosted fears that the Islamic State group's violent ideology is gaining a foothold in the country's restive southern islands, where a Muslim separatist rebellion has raged for decades. — with the Associated Press reporting from Marawi City

(Editor's note: The aircraft involved was initially identified as an S.211 but has since been identified as an SF-260. The story has been corrected)