The Pentagon on Sunday promised a full investigation of a suspected U.S. air strike that killed 22 people in an Afghan hospital run by the medical aid group Doctors Without Borders, or Médecins Sans Frontières (MSF).

The attack occurred in Kunduz, a city of 300,000 inhabitants, where battles were continuing on Sunday as Afghan government forces are trying to drive out Taliban militants who seized the locality almost a week ago, Reuters reported. The Afghans are backed by U.S. air power, and Defense Secretary Ash Carter admitted that "American air assets ... were engaged in the Kunduz vicinity."

"We do know that the structures that - you see in the news -- were destroyed. I just can't tell you what the connection is at this time," Carter told reporters traveling with him before landing in Spain on Sunday. The Pentagon would hold accountable "anybody responsible for doing something they shouldn't have done," the secretary promised.

An unidentified American military official, meanwhile, told The New York Times the attack may have been carried out by a U.S. AC-130 gunship that was supporting Special Operations forces on the ground in Kunduz. And the top U.S. commander in Afghanistan, Gen. John F. Campbell said his troops had come under fire in the vicinity of the hospital.

In a statement, the U.S. military confirmed an airstrike and explained that it had been targeting individuals "who were threatening the force" and that "there may have been collateral damage to a nearby medical facility."

Branding the attack a "war crime," however, MSF said the announced inquiry was insufficient as it would amount merely to an "internal investigation by a party to the conflict."

"This attack is abhorrent and a grave violation of International humanitarian law," Meinie Nicolai, the group's president, noted in a statement. "We demand total transparency from coalition forces. We cannot accept that this horrific loss of life will simply be dismissed as 'collateral damage.'"

President Barack Obama, for his part, on Saturday offered his condolences to the victims, referring to the strike as a "tragic incident."