President Bush, who rejected using American troops for “nation building” in his first campaign, is doing far more of it than his recent predecessors. More than 100,000 troops are now enmeshed in two important and difficult exercises in repairing failed states — Afghanistan and Iraq. In Haiti, a smaller American military contingent faces similar challenges. The fate of these three efforts will not only affect Mr. Bush’s re-election campaign, they will shape his presidential legacy.

While American military forces entered these countries for different reasons, in each they encountered a shattered society. Political and economic reconstruction became not just a moral, but a practical necessity. Without effective nation-building, American forces could leave these countries only to be summoned back.

None of these efforts are likely to succeed if they remain the responsibility of the American military alone. The lesson being driven home by Iraq — that international efforts work best and that defeating the enemy is not enough — apply everywhere. Progress ought to be measured against three benchmarks — securing stability, promoting democracy and resolving the underlying problems that prompted military intervention.

More than two years after American-led forces evicted the Taliban from Kabul, much of Afghanistan remains insecure. A relatively enlightened constitution has been adopted, but is not enforceable in most of the country where warlords rule. Women still face severe legal and social discrimination.

American troops went to Afghanistan to capture Osama bin Laden and oust the Taliban government that sheltered him. So far, Mr. bin Laden has not been captured and the Taliban has not been conclusively defeated. Even if both things are accomplished, that will not solve the problem. America took on the challenges of Afghanistan because the breakdown of governmental authority over nearly a quarter-century of civil war had opened the country to international terrorists. Until that authority is effectively re-established by a government that meets the needs and aspirations of Afghans of both genders, America’s work will not be completed.

After nearly a year of American occupation, Iraq still suffers from pervasive insecurity, which has now spread from the Sunni heartland to predominantly Shiite and Kurdish areas. The United States Army has been pushed close to its long-term deployment limits by the occupation, with no early relief in sight. An interim Iraqi constitution has been drafted, but its signing was held up over the weekend by differences over the crucial question of how governmental power is to be apportioned among rival religious and ethnic groups. Iraqis are now optimistic this it can be signed today. Still, no satisfactory formula has yet been devised for creating the interim government due to assume power July 1.

The Bush administration’s case for invading Iraq was based on a supposedly imminent threat from Iraqi unconventional weapons. No imminent threat was found. But Iraq’s scientists clearly know how to make those weapons and if continued chaos leads to a new dictatorship, covert work might resume. That gives America a practical interest in developing stable democratic structures that can outlast American military occupation.

Haiti has been a failed state almost from its start 200 years ago. Its leaders have been authoritarian and corrupt, its economy impoverished and uncompetitive, and its people forced, in increasing numbers, to seek work and a decent life abroad. Previous American interventions failed to address these deeper problems adequately, leading to new crises and new interventions at increasingly shorter intervals. To end that depressing cycle, Washington must look beyond shuffling personalities at the top of Haiti’s government to nurturing effective civic institutions and sustainable economic growth.

Functioning nations cannot be conjured into existence by foreign occupiers. They must be put together primarily from within. But in shattered societies like Afghanistan, Iraq and Haiti, no internal effort can get far without a substantial and sustained outside commitment.