The U.S. special forces soldiers who called in a devastating airstrike on a hospital in northern Afghanistan could not see the target and ordered the attack at the request of their Afghan partners, The Associated Press has learned.

Those details add to mounting indications that the U.S. military struck a medical facility and killed at least 30 noncombatants without properly vetting information provided by its Afghan allies. Afghan military elements had long resented the Doctors without Borders hospital, which treated Afghan security forces and Taliban alike but says it refused to admit armed men.

Immediately after the strike, Afghanistan's national security adviser told a European diplomat that his country would take responsibility because "we are without doubt, 100 per cent convinced the place was occupied by Taliban," according to notes of the meeting reviewed by the AP.

More than a month later, no evidence has emerged to support that assertion. Eyewitnesses tell the AP they saw no gunman at the hospital.

AC-130 gunship

An AC-130 U.S. military gunship, such as the one pictured here, was used in the airstrike on a Doctors Without Borders hospital in Kunduz, Afghanistan, on Oct. 3, 2015. (Senior Airman Julianne Showalter/U.S. Air Force)

The hour-long attack by an AC-130 gunship came after days of heavy fighting in Kunduz. About 35 members of the 3rd Special Forces Group had been helping about 100 Afghan special forces soldiers retake the city from the Taliban, a former U.S. intelligence official said. From their position in the governor's compound, they came under heavy assault by waves of Taliban fighters, and sought to use air power to destroy the Taliban's remaining command centres around the city.

The Afghans insisted that the hospital had become one of those command centres, and urged it to be destroyed, the former official said.

The U.S. commander could not see the medical facility. Afghan officials say their forces were also about 800 metres away, so they were not in a position to know, either.

Members of the special forces unit have told Rep. Duncan Hunter, a Republican who serves on the armed services committee, that they were unaware their target was a functioning hospital until the attack was over, said Joe Kasper, Hunter's spokesman.

The strike raises questions about whether the U.S. military can rely on intelligence from Afghan allies in a war in which a small contingent of Americans will increasingly fight with larger units of local forces.

Not justified

Also at issue is how American commanders allowed the strike to go forward despite reports in their databases that the hospital was functioning. Even if armed Taliban fighters had been hiding inside, the U.S. acknowledges it would not have been justified in destroying a working hospital filled with wounded patients.

President Barack Obama has apologized for the attack, one of the worst incidents of civilian casualties in the 14-year history of the U.S war effort. The Pentagon has said it was a mistake that resulted from both human and technical errors, and it is investigating, along with NATO and the Afghan government. The U.S. has declined to endorse Doctors without Borders' call for an independent probe.

Switzerland Doctors Without Borders

The staff of Medecins Sans Frontieres, MSF, (Doctors Without Borders) demonstrate in Geneva on Nov. 3, 2015 after a U.S. airstrike hit their hospital in Kunduz, Afghanistan. (Salvatore Di Nolfi/Associated Press)

The AP has reported that some American intelligence suggested the Taliban were using the hospital. Special forces and Army intelligence analysts were sifting through reports of heavy weapons at the compound, and they were tracking a Pakistani intelligence operative they believed was there.

It's unclear how much of that intelligence came from Afghan special forces.

Thought Taliban had control

The U.S. 3rd Special Forces Group knew the hospital was treating patients, according to a daily log by one of its senior officers written Oct. 2. Doctors Without Borders had made sure the U.S. military command in Kabul had the exact co-ordinates of the hospital.

But 3rd Group also believed the compound was under the control of the Taliban, the daily log says, without explaining why. Carter Malkasian, a senior adviser to the chairman of the Joint Chiefs of Staff, emailed Doctors without Borders two days before the attack to ask about it. He was told it wasn't true.

Witnesses tell the AP they saw no evidence of Taliban activity.

"During the whole week of the Kunduz violence leading up to the attack on the hospital, I never saw any Taliban with guns, not even inside the compound, let alone in the buildings," said Gul, who goes by one name and worked as a security guard at the hospital.

Afghan officials insist that the strike was justified.