KABUL, Afghanistan -- The spokesman for President Hamid Karzai said Thursday that the C.I.A. was responsible for calling in an airstrike on April 7 that left 17 Afghan civilians dead, 12 of them children, and that the secret Afghan militias that the agency controls behaved as if they were "responsible to no one."
"It was a C.I.A. operation using a security structure that was in full service of the C.I.A. and run by the C.I.A.," said the spokesman, Aimal Faizi, who said his remarks reflected the views of the Afghan president. Mr. Faizi also criticized the agency and American Special Operations troops for running numerous similar militias elsewhere in Afghanistan, with similar problems.
The criticism from Mr. Faizi and other Afghan officials pulled aside a curtain on a clandestine operation that went badly awry in the rugged mountains of eastern Kunar Province, killing an American C.I.A. employee and seriously wounding three other Americans working for the agency. The American who died had been in charge of a group of undercover paramilitaries known as the 0-4 Unit, a so-called Counterterrorist Pursuit Team, according to Afghan investigators.
Afghan reaction to the episode challenges the core assumptions in negotiations with the Afghan government about the nature of the United States' presence in Afghanistan after 2014. The military wants a mission with two main goals: training Afghan forces and conducting counterterrorism raids against groups like Al Qaeda. Special Operations forces and irregular forces like the militias run by the C.I.A. are a crucial part of the effort, American officials say.
But Mr. Karzai has been deeply suspicious about the activity of irregular forces in his country, and in March he banned American Special Operations forces from operating in Wardak Province. Now, the C.I.A. is the focus of his ire.
A spokesman for the C.I.A. would not comment about the case.
A spokesman for the American military, Col. Thomas Collins, declined to comment on the raid in Kunar Province or to discuss the military's investigation into it. He said only that the operation was run by the National Directorate of Security, the Afghan intelligence agency.
"There was a battle going on, this N.D.S. unit was under grave pressure," Colonel Collins said. "But as to what caused the civilian casualties, that's still under investigation."
Mr. Faizi said that after Mr. Karzai received a report from his own investigation, he fired the head of the National Directorate of Security in Kunar Province, whom others identified as Gen. Saadullah. (He uses only one name.)
But Mr. Faizi said that the 0-4 Unit, a roughly 1,200-member force, was not truly under the control of the Afghan security agency, asserting instead that American intelligence officials were solely responsible for the unit. "It was a joint op at most in name," he said, "but really in fact a C.I.A.-run parallel security structure, and such structures have been a factor of insecurity themselves."
Mr. Faizi said Mr. Karzai had ordered a review throughout the country of all Counterterrorist Pursuit Teams, which are mostly used in the east and the south, and of similar irregular forces run by the C.I.A. or by American Special Operations units.
"We are informed five minutes before they are conducting an operation," Mr. Faizi said, "and our security agencies do not have authority over them."
A United States official familiar with the events disagreed with that characterization. "The Afghan unit involved in this prolonged firefight with the Taliban was under Afghan government control -- rumors of a 'rogue' unit or Americans commanding the team reflect internal power struggles in Kabul," the official said, speaking on the condition of anonymity.
Details about the fighting in Kunar were scant in the days afterward. Mr. Karzai appointed a delegation to go there and investigate, and he later said he blamed both the Taliban and international forces for causing the civilian deaths, although at the time he did not mention the C.I.A. by name.
"As the reports confirm that armed Taliban were there in the area, we strongly condemn the use of civilians and their homes as shields by the Taliban, as well as we do not accept the conduct of any airstrike on residential areas under any name and for any purpose whatsoever," Mr. Karzai said. "This act by the I.S.A.F. forces was a violation of human rights and the presidential executive order which bans airstrikes during operations in residential areas."
Mr. Karzai ordered the ban on airstrikes on Feb. 16 after a coalition airstrike in Kunar Province killed 10 civilians, five of them children. That strike took place in the same district as the April 7 fighting -- Shigal district -- but in a different village. At the time, officials said that the airstrike had been called to support a joint operation involving the Afghan security agency, and that an investigation was under way.
Afghan officials, including the head of Mr. Karzai's delegation investigating the latest Kunar episode, said that the earlier Kunar attack also involved elements of the 0-4 Unit under the command of American C.I.A. personnel, including the unidentified American who was killed on April 7.
A copy of the Kunar delegation's report was obtained by The New York Times, and two members of the delegation were interviewed about the fighting: its chairman, Shuja ul-Malk Jalala, an adviser to Mr. Karzai, and Hajji Sakh Mushwanai, a member of Parliament from Kunar Province. One member of the 0-4 Unit was also interviewed, speaking on the condition of anonymity because he was not allowed to comment to the news media.
They all said that 75 members of the 0-4 Unit, with four American advisers along, marched for four hours into a mountainous area near the village of Sunoo on the night of April 6 and the morning of April 7.
The force was planning to arrest Taliban commanders suspected of having ties to Al Qaeda, and around 5 a.m. on April 7, it raided a house where one of them, Ali Khan, was believed to be living. But the only man present was a mentally ill man who could neither speak nor hear; he and about two dozen women and children were herded into one room of Mr. Khan's house, the Afghans said.
A short time later, the house came under Taliban fire from all sides. "We had no choice but to stay in that house; we were totally surrounded," the 0-4 Unit member said. "We thought this was the last day of our lives."
One of the investigators, Mr. Mushwanai, saw matters differently. "These are irregular soldiers, and they do not know the rules of war very well," he said. "By being in the house, it made those women and children a target."
The Taliban's barrage lasted until 8 a.m., when reinforcements from the 0-4 Unit arrived. The force that was pinned down in the house tried to withdraw, and the four Americans were hit by insurgent fire. Air support was called in to protect the retreat and to allow medical evacuation helicopters to rescue the wounded.
When the 0-4 Unit members left the house and withdrew from the area, they told investigators, all of the women and children were still alive. Hours later, when villagers reached the scene, all but a few of the women were dead, the report said. The investigators said they determined that none of the bombs or rockets used in the air-support operation -- which included drones, jets and attack helicopters, they said -- hit the house where the victims were. But the concussion from the explosions made the upper floor of the mud-and-timber house collapse on top of the victims.
One of the investigators, Mr. Jalala, said that of the 12 children killed, all were the sons, daughters, nieces or nephews of the Taliban commander, Mr. Khan, who was among seven insurgents killed in the attack. On that basis, Mr. Jalala rejected what he described as a coalition military claim that the Taliban had killed the civilians for propaganda purposes. "Common sense just doesn't accept this," he said. "Nobody would do that to their own family."
He said it was clear from pictures that the house had collapsed on the family, and that the strikes, including by rockets that exploded in the yard, were the only possible cause.
Mr. Faizi, the presidential spokesman, agreed with that assessment. "There is no evidence they were killed by the Taliban," he said. "These children were killed only because of the airstrikes. These are irresponsible armed militias and irresponsible armed people, carrying out operations for and on the payroll of the C.I.A."
Mr. Mushwanai, the member of Parliament from Kunar, said his own home had been raided by the 0-4 Unit twice. "They shot out the TV and the water cooler," he said. "America will leave behind these types of forces in 2014, and it will further destabilize Afghanistan."
An Afghan employee of The New York Times contributed reporting from Kunar Province, and Mark Mazzetti from Washington.
This article originally appeared in The New York Times.