SEMITAY BAZAAR, Afghanistan — After the declaration this weekend that the battle for the Taliban enclave of Marja had been won, for the Marines standing behind sandbags and walking patrols, the more complicated work has begun. With it will be a test of the strategy selected by President Obama and the generals now running the Afghan war.

After months of preparation for the largest offensive in Afghanistan since 2001, and two weeks of fighting and moving forces around a sprawling desert battlefield, the last pieces of the campaign’s opening push into a Taliban enclave had come together by the weekend.

Marine units were finishing sweeps of contested ground, clearing the last stretches of roads of hidden bombs, and reinforcing hastily erected patrol bases and outposts. More Afghan government forces were arriving, increasing the manpower to counter the Taliban fighters engaged in the guerrillas’ routine of emplacing booby traps and challenging Marine patrols with hit-and-run fights.

The transition from deliberate combat operations to creating security for the often lackluster Afghan government was under way. A set of tasks more complex than fighting was ahead: encouraging the population of Marja to accept, much less support, an outside government presence.