Residents carry the bodies of those killed during fighting between Iraqi forces and Islamic militants in western Mosul on March 24, 2017.

A U.S. airstrike conducted March 17 killed more than 100 Iraqi civilians in Mosul, the Pentagon confirmed Thursday, noting the strike inadvertently set off explosives planted in the building by the Islamic State.

“The investigation determined that ISIS emplaced a large amount of explosive material in a structure containing a significant number of civilians and then attacked Iraqi forces from the structure,” the Pentagon said in a statement.

The airstrike was conducted as part of the Iraqi government’s continued efforts to expel ISIS from western Mosul, the country’s second-largest city. The Pentagon said the Iraqis requested the airstrike, which aimed to destroy the top floor of a building that held two ISIS snipers. The blast prompted the “detonation of a large amount of explosive material,” which caused the building to collapse, the statement said.

The investigation followed criticism that the U.S.-led coalition did not take adequate precautions to protect civilians. The inquiry concluded that at least 105 people were killed during the blast, marking the greatest loss of civilian life since the U.S. began targeting ISIS in Iraq and Syria in 2014. The Pentagon reaffirmed neither the U.S.-led coalition nor its Iraqi counterparts knew civilians were in the building, and that they were unaware explosives had been placed inside it.

“The coalition takes every feasible measure to protect civilians from harm,” Maj. Gen. Joe Martin, the commander of ground forces for the U.S.-led coalition, said in a statement. “The best way to protect civilians is to defeat ISIS.”

More than 350 civilians have been killed in U.S.-led airstrikes against ISIS since 2014, according to the Pentagon, though other monitors say the estimate is far higher.