A NATO air strike killed at least 30 Afghan civilians, including women and children, on Thursday in the volatile northern province of Kunduz, officials said, after a Taliban assault there left two American soldiers dead.
The airstrike, which occurred early Thursday, triggered emotionally-charged protests in the provincial capital, with the victims` relatives rallying outside the governor`s office while carrying the bodies of dead children.
The carnage underscores worsening insecurity after the Taliban last month overran Kunduz city for the second time in a year, as NATO-backed Afghan forces struggle to beat back the insurgents.
"Afghan forces and coalition troops conducted a joint operation against the Taliban insurgents," provincial spokesman Mahmood Danish told AFP. "In the bombardment 30 Afghan civilians were martyred and 25 others were wounded."
Police spokesman Mahmoodullah Akbari gave the same toll to AFP, adding that the dead included infants aged as young as three months and other children.
"They were asleep when their house came under attack by coalition troops," Akbari said.
In a brief statement on Twitter, NATO conceded it was behind the airstrike.
"Airstrikes were conducted in #Kunduz to defend friendly forces under fire. All civilian casualty claims will be investigated," it said.
The strike occurred on the outskirts of the city after a firefight killed two US soldiers and three Afghan special forces during an anti-Taliban operation in Kunduz.
It was not immediately clear if the two incidents were related.
The firefight occurred as American soldiers were assisting Afghan troops to clear a Taliban position and disrupt the group`s operations in Kunduz, US forces said in a separate statement.
"On behalf of all of US Forces - Afghanistan, today`s loss is heartbreaking and we offer our deepest condolences to the families and friends of our service members who lost their lives today," said John Nicholson, the top US and NATO commander in Afghanistan.
"Despite today`s tragic event, we are steadfast in our commitment to help our Afghan partners defend their nation," he added, without disclosing the names of the dead soldiers.The killings come just days before the US presidential election.
During three lengthy debates between presidential candidates Hillary Clinton and Donald Trump, Afghanistan got scarcely a passing mention -- even though the situation there will be an urgent matter for the new president.
Either one of them will inherit America`s longest war with no end in sight.
The US military, which leads a NATO mission to train and assist local forces after their combat mission ended in 2014, often gives upbeat assessments about Afghan military performance.
But as Afghan military forces near the end of a second year leading security operations without full NATO assistance, they are sustaining heavy casualties.
The Taliban`s apparent strategic goal in 2016 is to seize another provincial capital like they briefly did in Kunduz last year, in a stinging blow to Afghan forces.
They have launched multiple assaults in recent months including in Kunduz, Lashkar Gar in poppy-growing Helmand province and Tarinkot, the capital of Uruzgan province.
The worsening conflict has prompted US forces to step up airstrikes to support their struggling Afghan counterparts, fuelling the perception they are increasingly being drawn back into the conflict.