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.