About a half-dozen Afghan policemen shared the Shrine with a squad of marines, who rotated in and out. Perhaps because of the forced intimacy of the tiny outpost and the shared experience of coming under constant attack, the marines and Afghans stationed there enjoyed an uncommonly functional, even fraternal, relationship. They knew one another’s names, shared responsibilities, laughed and joked and sometimes ate together. All of the police officers on the Shrine were Tajiks or Uzbeks from northern Afghanistan who said they enlisted and came to the Pashtun south because they believed in their country and its government; they were nationalists. Their commander was a gaunt middle-aged Uzbek named Ghulam Jalani. Over several meals of rice and lamb in the cramped hut where his men quarter, Jalani expressed deep admiration for the Marines. He also fears for the day they go home. “I am not an educated man,” Jalani told me one night. “In fact, I am illiterate. But I tell you: if the Marines leave here, the Taliban will come back.”

The following morning, a squad from the new unit showed up for its first week at the Shrine. The squad leader, 25-year-old Erick Granados, is a first-generation American whose parents immigrated to the United States from El Salvador. Built like a wrestler and covered in tattoos, he is also the shortest man in the platoon. Even by Marine standards, Granados is deeply, almost fanatically, patriotic. One of the things he brought with him to Afghanistan was a large American flag. Upon arriving at the Shrine, while his squad was still unpacking, Granados climbed onto a bunker roof and planted the flag between two sandbags. It was a surprisingly potent image — something you rarely see in Afghanistan, where the U.S. deliberately fights the stigma of an occupying force by framing its activities as strictly ancillary to the national government.

I would learn that marines from the previous battery also had a flag. Invariably, they said, whenever it went up, the Shrine came under attack.

This time, the insurgents waited until dark, firing on the outpost with automatic weapons a little before midnight. Jalani and the other Afghan police officers sprinted to their machine guns in sandals and T-shirts, spraying bullets haphazardly into the dark. Using thermal optics, Granados was able to locate two men as they descended into a narrow canyon that snakes through an area called Chinah in the Taliban-occupied country north of the Shrine. After calling in illumination rounds that burned slow trails through the night, radiating pools of incandescence across the black expanse, the marines concentrated several volleys on the canyon. Staff Sgt. Vincent Bell seized the opportunity to observe a policeman firing a PK machine gun. Bell had deployed four times to Iraq, but this was his first tour in Afghanistan. As the policeman, pausing now and then to ash the cigarette that hung loosely from his mouth, showered a fusillade of bullets in the general vicinity of the canyon, Bell cried out: “You boys are raw! I mean raw, raw, raw!” The Afghan gave him a quizzical look, as if uncertain whether he was being chastised. “Don’t get me wrong,” Bell told him. “I like it!”

Eventually, the gunshots petered out. But a couple of hours later, a marine noticed two men digging with shovels near the road that connects the Shrine to the main base at the dam. He alerted Sergeant Granados, who magnified their images using a remote-controlled camera mounted atop a tower that relays infrared video to a monitor at its base. After watching the men excavate a hole, place an object inside and bury it, Granados radioed his superiors and requested permission to shoot them. The permission was denied. “They want to see components,” Granados complained. “They want to see wires, jugs. We saw something getting put into the ground. To them, that isn’t good enough.” The marines watched the men toss a handful of branches over their project, then flee quickly back to Chinah.

Intermittent gun battles continued until dawn, when the sun bloomed from behind a series of serrated ridgelines, and the whole wasted valley — the cattails that crowd the river’s banks, the yellow pastures where ragged camels graze, the wind-bent corn against the western desert — emerged in bright relief. I was drinking tea with Jalani when two trucks, loaded with farmworkers heading out to harvest the last of the year’s crop, came bumping down the road leading to the outpost. As they reached the place where the two men were seen digging in the night, a tremendous explosion echoed off the hills and the trucks vanished in a geyser of erupted earth. Thirteen passengers, including women and children, had been crammed into the trucks, but somehow none were killed or badly hurt. A few minutes later, carrying satchels and tools, the Afghans continued toward their fields on foot.

“Where are they going?” I asked Jalani.

“To work,” he said.

That afternoon, another squad from Granados’s platoon, led by Sgt. Samuel Windisch, conducted its first foot patrol in Kajaki, north and west from the Shrine, into an area called the brown zone, where lawless Zamindawar abuts the territory controlled by the Marines. The purpose of the patrol, Windisch told me, was “to test the enemy’s forward line of engagement. We’re looking for a fight, basically.” In 2005, Windisch was shot by a sniper in Fallujah. The bullet caught the upper right corner of his chest plate, knocking him down with a force that he said felt like someone hitting him with a sledgehammer. He re-enlisted nonetheless, and two years later he did another tour in the same city. When I asked whether the outgoing marines offered him any advice about the route he planned to take today, Windisch replied, “Yeah: ‘You’re gonna get shot at.’ ”