A drone strike in Kabul last month killed as many as 10 civilians, including seven children, the US military says, apologising for the a "tragic mistake".
The Pentagon had said the August 29 strike targeted an Islamic State suicide bomber who posed an imminent threat to US-led troops at the airport as they completed the last stages of their withdrawal from Afghanistan.
Even as reports of civilian casualties emerged, the top US general had described the attack as "righteous".
The head of US Central Command, Marine Corps General Frank McKenzie, said that at the time he had been confident it averted an imminent threat to the forces at the airport.
"Our investigation now concludes that the strike was a tragic mistake," McKenzie told reporters on Friday.
He said he now believed it unlikely that those killed were members of the local Islamic State affiliate, ISIS-Khorasan, or posed a threat to US troops.
The Pentagon was considering reparations, McKenzie said.
The killing of civilians, in a strike carried out by a drone based outside Afghanistan, has raised questions about the future of US counter-terrorism strikes in the country, where intelligence gathering has been all but choked off since last month's withdrawal.
And the confirmation of civilian deaths provides further fuel to critics of the chaotic US withdrawal and evacuation of Afghan allies, which has generated the biggest crisis yet for the Biden administration.
In a statement, Defense Secretary Lloyd Austin said the drone strike had killed a Mr Ahmadi who worked for a non-profit called Nutrition and Education International.
"We now know that there was no connection between Mr. Ahmadi and ISIS-Khorasan, that his activities on that day were completely harmless and not at all related to the imminent threat we believed we faced," Austin said in the statement.
"We apologise, and we will endeavour to learn from this horrible mistake."
Reports had emerged almost immediately that the drone strike in a neighbourhood west of Kabul's Hamid Karzai International Airport had killed civilians including children.
Video from the scene showed the wreckage of a car strewn around the courtyard of a building. A spokesman for Afghanistan's new Taliban rulers, Zabihullah Mujahid, said at the time the attack killed seven people, and the Taliban was investigating.
The strike came three days after an Islamic State suicide bomber killed 13 US troops and scores of Afghan civilians who had crowded outside the airport gates, desperate to secure seats on evacuation flights, after US-trained Afghan forces melted away and the Taliban swept to power in the capital.
Following the suicide bombing at the airport, the US military launched a drone strike in eastern Afghanistan that it said killed two Islamic State militants. That strike is not under review.
The second, mistaken strike came as the US military was on heightened alert, with officials warning they expected more attacks on the airport, including from rockets and vehicle-borne explosive devices, as the Pentagon wrapped up its mission.
Australian Associated Press