The attack that at an Afghan hospital run by Médecins Sans Frontières (MSF) is the latest in a long line of bloody misjudgments by foreign forces in Afghanistan.
Deaths from airstrikes, which at their worst point killed hundreds of Afghan civilians a year, were a key factor in turning Afghan sentiment against foreign troops during more than a decade of war.
Men, women and children died in bombings on homes, and once even a raid on who had clustered around abandoned tankers to collect free fuel.
The aftermath of such strikes followed a familiar pattern that exacerbated anger, with Nato denying it had hit civilians or disputing the numbers of dead.
Under heavy pressure, Nato and the US tightened rules of engagement and held regular meetings to discuss civilian casualties with human rights groups and NGOs. Such policies brought down deaths.
Still, airstrikes became so politically toxic that then-President Hamid Karzai banned them , a move which drew the anger of his own forces, who said it left them vulnerable to the Taliban.
The policy was reversed after Karzai stepped down, but the MSF hospital should have been clearly marked on maps used to plan any strike. It had been there for years and was one of just a handful of medical centres in the area. MSF had recently reminded the US and Afghan forces of its GPS coordinates.
There was no excuse for targeting it, Human Rights Watch said, even if a police officer’s claim that forces had taken shelter inside should prove correct.
“Given the hospital’s protected status and the large numbers of civilians and medical personnel in the facility,” the group said in a statement, “attacking the hospital would still likely have been an unlawfully disproportionate attack, causing greater harm to civilians and civilian structures than any immediate military gain.
“The require that even if military forces misuse a hospital to deploy able-bodied combatants or weapons, the attacking force must issue a warning to cease this misuse, setting a reasonable time limit for it to end, and attacking only after such a warning has gone unheeded.”
The attack and deaths have already prompted anger towards US and Afghan forces, but despite the scale of the tragedy, President Ashraf Ghani would struggle to bring in another ban on airstrikes.
Back-up from planes and drones has become one of the clearest military advantages for often ramshackle Afghan forces fighting a hardened insurgency.
The battle for Kunduz provided a blunt reminder of how important such weapons are, as the last line of defence for an airport where thousands of civilians and troops had taken shelter after the Taliban seized most of the city.
Taliban fighters had breached the airport perimeter before airstrikes helped push them back, protecting those inside and allowing ground troops to begin the slow battle to reclaim the city.