KABUL (Reuters) - A U.S. military investigation confirmed that dozens of Afghan civilians were killed in a special forces operation near the northern city of Kunduz last year, but found troops had acted in self-defense and decided no action would be taken against them.

An Afghan man inspects a house destroyed during an air strike called in to protect Afghan and U.S. forces during a raid on suspected Taliban militants, in Kunduz, Afghanistan November 4, 2016. REUTERS/ Nasir Wakif

The report, published on Thursday, said 33 civilians were killed and 27 wounded last November when a U.S. and Afghan special forces unit returned fire against Taliban fighters in the village of Boz, near Kunduz, and called in air support.

“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,” the U.S. military in Afghanistan said in a statement.

The raid, involving both U.S. and Afghan special forces, took place during operations to push back Taliban fighters from the vicinity of Kunduz, the strategic city they had come close to overrunning in October.

The unit came under heavy fire from Taliban fighters using civilian houses as firing positions and suffered several casualties before calling in air support, the military added.

“Regardless of the circumstances, I deeply regret the loss of innocent lives,” Gen. John Nicholson, commander of U.S. Forces in Afghanistan said in the statement, adding that “all possible measures” would be taken to protect Afghan civilians.

While the investigation concluded that more than 30 civilians had been killed, it said aircraft providing support had used “the minimum amount of force required to neutralize the various threats from the civilian buildings”.

It also found that no civilians were seen or identified, and the dead and wounded were probably inside the buildings used by Taliban fighters. Some of the casualties may also have been caused by a Taliban ammunition dump that exploded.

Two U.S. soldiers and three Afghan army commandos were killed and another four Americans and 11 Afghan commandos wounded, with around 26 Taliban fighters also killed.

Last year, the U.S. military disciplined 16 service members over a separate incident in Kunduz in 2015, when a U.S. air strike killed 42 people in a hospital run by medical aid group Medecins Sans Frontieres.