The Taliban attacked the Afghan police compound at first light, coming from all sides at the American Green Berets holed up inside. The insurgents fired assault rifles, heavy machine guns and rocket-propelled grenades. They came in what a soldier called “human waves.”

Not even strafing runs by American F-16 fighters stopped the assault. The elite American soldiers — whose mission was only to train and advise Afghan troops — had never seen a firefight as intense.

Holding the compound, another soldier said, took an “Alamo defense.”

On the morning of Oct. 1, about 30 soldiers were in close-quarters combat against Taliban fighters — even though White House and Pentagon officials have repeatedly insisted that American troops no longer play that role.