Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

American forces called in airstrikes on civilian homes in Afghanistan after an operation to capture Taliban leaders spiraled out of control into a bloody firefight, a U.S. military report found Thursday.

November's incident resulted in the deaths of 33 Afghan civilians, two U.S. soldiers, three Afghan Army commandos and approximately 26 Taliban fighters, according to the investigation by U.S. Forces — Afghanistan.

"Regardless of the circumstances, I deeply regret the loss of innocent lives," said Gen. John Nicholson, commander of America's forces in the country.

"Those who ordered this attack and those who bombed us should be brought to justice in open court.”

The report said Taliban fighters were firing from inside civilian homes, and that U.S. aircraft "used the minimum amount of force required" to take out the militants and protect friendly forces.

"The investigation concluded that U.S. forces acted in self-defense, in accordance with the Law of Armed Conflict, and in accordance with all applicable regulations and policy," it said.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

The Americans were providing "advice and assistance" to Afghan commandos attempting to capture Taliban leaders involved in violence in the region two months earlier, the report said.

They arrived on Nov. 2 at Boz Village, near the northern battleground city of Kunduz. After they began taking fire they said they were forced to call in airstrikes on the area to defend themselves.

"No civilians were seen or identified in the course of the battle," the report said. "The civilians who were wounded or killed were likely inside the buildings from which the Taliban were firing."

A map showing the Afghan city of Kunduz. Google Maps

These airstrikes were also used to provide cover for medical personnel, who came under Taliban fire while trying to evacuate the dead and wounded.

"On this occasion the Taliban chose to hide amongst civilians and then attacked Afghan and U.S. forces," Nicholson said. "I wish to assure President [Ahsraf] Ghani and the people of Afghanistan that we will take all possible measures to protect Afghan civilians."

U.S.-backed Afghan forces have been involved in fierce battles with a resurgent Taliban in and around Kunduz, which the Taliban briefly captured in late 2015.

During the fightback, a U.S. AC-130 gunship mistakenly bombed a Doctors Without Borders hospital and killed at least 42 people, including at least 14 staff and 24 patients.

Despite President Barack Obama's declaration that the Afghan combat mission over in 2014, U.S. warplanes carried out more than 700 airstrikes last year — far surpassing the 500 of last year — according to Reuters. Nearly 9,000 U.S. personnel remain in the country.

The military’s report brought scant closure for some locals caught up in the bombing, however.

Dad Mohammad, a 45-year-old elder in the village, told NBC News that “those who ordered this attack and those who bombed us should be brought to justice in open court.”

Mohammad’s cousin and his cousin’s children died in the attack, and he said kids as young as two months old were among the victims.

“They say to us, ‘We are fighting against insurgents and terrorism,’ they say, “We have advanced and state-of-the-art weapons.’ Then how can they bomb a residential area?” he said. “I didn’t see any kind of bloody incident like this in my entire life.”