WASHINGTON  An internal review by the American military has found that a local Afghan police chief and another district leader helped Taliban militants carry out an attack on July 13 in which nine United States soldiers were killed and a remote American outpost in eastern Afghanistan was nearly overrun.

Afghan and American forces had started building the makeshift base just five days before the attack, and villagers repeatedly warned the American troops in that time that militants were plotting a strike, the report found. It said that the warnings did not include details, and that troops never anticipated such a large and well-coordinated attack.

The assault involved some 200 fighters, nearly three times the number of Americans and Afghans defending the site.

As evidence of collusion between the district police chief and the Taliban, the report cited large stocks of weapons and ammunition that were found in the police barracks in the adjacent village of Wanat after the attackers were repelled. The stocks were more than the local 20-officer force would be likely to need, and many of the weapons were dirty and appeared to have been used recently. The police officers were found dressed in “crisp, clean new uniforms,” the report said, and were acting “as if nothing out of the ordinary had occurred.”