COMBAT OUTPOST LOWELL, Afghanistan  The small stone castle, sandbagged and bristling with weapons and American soldiers, rises from a rock spur beside the Landai River. Mountains lean overhead.

Once a hunting lodge for Mohammad Zahir Shah, Afghanistan’s last king, the castle is home for a year for an American cavalry troop, an Afghan infantry company, a Navy corpsman and two American marines. In the deadly contest for Afghanistan’s borderlands, it plays what might seem a singularly unattractive role. The position lies exposed near the bottom of a natural amphitheater deep within territory out of government control.

Insurgents hide in caves surrounding it and in villages nearby, operating unhindered almost to the castle’s concertina wire and lobbing mortar shells toward it at will. The steep slopes facing the walls are littered with shattered boulders and trees blown to splinters by the artillery and airstrikes with which the soldiers have fought back.

The Americans’ mission is to disrupt the Taliban and foreign fighters on supply paths from Pakistan’s tribal areas. Col. John Spiszer, the commanding officer for the larger task force in the region, distilled how the mission often worked. The American presence, he said, is a Taliban magnet, drawing insurgents from more populated areas and enhancing security elsewhere.