More than 40,000 Iraqi civilians have been killed since the American-led invasion of Iraq in 2003, and the rate at which civilians die has been increasing in recent months. Many thousands of innocent Iraqis have been detained, and some have been abused by American troops. Many others have been tortured or killed by Iraqi police. Basic services have been lacking in large portions of the country for three years. Civil war looms, conjuring memories of the 16-year Lebanese civil war, during which more than 100,000 people were killed out of a population of fewer than 4 million.

Yet, if the United Nations were to have its way, the Iraqi debacle would be just the first in a series of such wars -- the effect of a well-meaning but ill-considered effort to make humanitarian intervention obligatory as a matter of international law. Today Iraq, tomorrow Darfur.

Civilians suffer in all wars, but the suffering of Iraqi civilians in this war is particularly unfortunate because one of the main justifications for the war was humanitarian: to rescue suffering Iraqis from a tyrant. There were other justifications, of course, including the related but distinct idea that bringing democracy to Iraq would enhance America's long-term security. But the humanitarian justification was embraced by many who rejected the other justifications, including liberal elites as well as some conservatives, and it helped mobilize public opinion behind the war. Events have served the humanitarian justification poorly.

The idea that war can have a humanitarian as well as a national security justification has a long pedigree and surface plausibility. Some of the worst atrocities of the 20th century occurred in weak states whose governments could not have resisted a foreign military invasion. The genocide in Rwanda, which killed more than 800,000 people in a few months, was eventually halted by a force of Tutsi rebels; surely a Western army could have stopped it sooner. If nations can intervene at little cost to themselves because the target nations are weak and by doing so they prevent massive human suffering, then surely they should do so. The logic seems compelling.

But logic is no substitute for experience, and experience shows that humanitarian war is an oxymoron. The first blow to the idea was the failed intervention in Somalia in 1993. U.S. forces sent to maintain the peace while aid was distributed to millions of starving civilians were withdrawn after just 18 U.S. soldiers died. Policymakers drew the lesson that the American public will not tolerate casualties in a humanitarian war that has no clear national security justification. This lesson guided President Bill Clinton's refusal to authorize military intervention during the Rwandan genocide and his decision to limit U.S. military intervention in Kosovo in 1999 to high-altitude bombing, which ensured that no American pilots were killed -- at the expense of civilians on whose heads errant bombs fell. The Kosovo intervention, although regarded as a success in some quarters, has cost billions of dollars, required a seven-year occupation and could turn out to be a slow-motion version of Iraq.

The Iraq war itself has dealt the second blow. The problem with humanitarian intervention is not only that the costs are usually too high, but it turns out that the benefits usually are low. There are just too many risks and imponderables when war is used to prevent atrocities rather than to defeat an enemy. Military weapons inevitably kill civilians, and smart tyrants foil smart bombs by using their own civilians as shields. Dictators understand that a war premised on humanitarianism fails if they can make the invader kill their citizens. Removing the dictator risks civil war, which is almost always worse than the original abuses. Replacing him with another dictator only puts off the atrocities until another day. Long-term occupation breeds hostility, then insurgency and violence. In comparison with this, the original ruler might not seem so bad after all.

Saddam Hussein was an especially bad tyrant, and Iraqi civilian casualties attributable to the U.S. intervention do not yet equal what he was able to accomplish, albeit over a longer period. The Kurds and many Shiites are better off. And many Iraqis continue to think that the war was worth it, according to polls.

But polls do not reveal the opinions of dead Iraqis. The humanitarian effect of the war has been at best ambiguous against the baseline of the containment period that preceded it, and if current trends continue, the overall effect will be that of a humanitarian disaster.

Many people blame the humanitarian costs of the war in Iraq on the Bush administration's execution of it. This view is a psychological crutch that allows defenders of humanitarian intervention to keep the ideal alive for the next, presumably competent, administration of a President Hillary Clinton or John McCain. But complaints about this war are not noticeably different from complaints about earlier wars, where small mistakes (identifiable as such with the benefit of hindsight) resulted in enormous harm.

The Iraq war, consistent with experience, suggests that humanitarian wars will rarely yield humanitarian results. Why, then, is there a so-called "responsibility to protect" movement to make humanitarian intervention obligatory as a matter of international law? And why was this idea endorsed by the United Nations during its millennium summit?

The best humanitarians of our day recognize that we face a painful dilemma: to tolerate atrocities in foreign states or to risk committing worse atrocities in the course of ending them. From Rwanda, many people drew the lesson that failure to intervene is the worse option. The Iraq war may be the first step in unlearning this lesson. If not, an intervention in Darfur surely will be.

The writer is a professor of law at the University of Chicago and co-author of "The Limits of International Law."