MANILA — An airstrike by the Philippine military killed 11 of the country’s own soldiers and injured seven others as the government struggled to take back the southern city of Marawi from insurgents loyal to the Islamic State, officials said on Thursday.

The deaths came more than a week after the military moved to capture an insurgent leader only to be surprised by heavily armed rebels who went on to seize much of the city, holding a Roman Catholic priest and several others hostage. Since then the government has been using airstrikes to try to drive out the rebels.

“A group of our military army men were hit by our own airstrikes,” the defense secretary, Delfin Lorenzana, said in a text message to reporters.

“The coordination was not properly done so we hit our own people,” he added, calling the soldiers’ deaths a result of “the fog of war.”