Writing in these pages in early 2008, we put the total cost to the United States of the Iraq war at $3 trillion. This price tag dwarfed previous estimates, including the Bush administration's 2003 projections of a $50 billion to $60 billion war.

But today, as the United States ends combat in Iraq, it appears that our $3 trillion estimate (which accounted for both government expenses and the war's broader impact on the U.S. economy) was, if anything, too low. For example, the cost of diagnosing, treating and compensating disabled veterans has proved higher than we expected.

Moreover, two years on, it has become clear to us that our estimate did not capture what may have been the conflict's most sobering expenses: those in the category of "might have beens," or what economists call opportunity costs. For instance, many have wondered aloud whether, absent the Iraq invasion, we would still be stuck in Afghanistan. And this is not the only "what if" worth contemplating. We might also ask: If not for the war in Iraq, would oil prices have risen so rapidly? Would the federal debt be so high? Would the economic crisis have been so severe?

The answer to all four of these questions is probably no. The central lesson of economics is that resources -- including both money and attention -- are scarce. What was devoted to one theater, Iraq, was not available elsewhere.

Afghanistan

The Iraq invasion diverted our attention from the Afghan war, now entering its 10th year. While "success" in Afghanistan might always have been elusive, we would probably have been able to assert more control over the Taliban, and suffered fewer casualties, if we had not been sidetracked. In 2003 -- the year we invaded Iraq -- the United States cut spending in Afghanistan to $14.7 billion (down from more than $20 billion in 2002), while we poured $53 billion into Iraq. In 2004, 2005 and 2006, we spent at least four times as much money in Iraq as in Afghanistan.

It is hard to believe that we would be embroiled in a bloody conflict in Afghanistan today if we had devoted the resources there that we instead deployed in Iraq. A troop surge in 2003 -- before the warlords and the Taliban reestablished control -- would have been much more effective than a surge in 2010.

Oil

When the United States went to war in Iraq, the price of oil was less than $25 a barrel, and futures markets expected it to remain around that level. With the war, prices started to soar, reaching $140 a barrel by 2008. We believe that the war and its impact on the Middle East, the largest supplier of oil in the world, were major factors. Not only was Iraqi production interrupted, but the instability the war brought to the Middle East dampened investment in the region.

In calculating our $3 trillion estimate two years ago, we blamed the war for a $5-per-barrel oil price increase. We now believe that a more realistic (if still conservative) estimate of the war's impact on prices works out to at least $10 per barrel. That would add at least $250 billion in direct costs to our original assessment of the war's price tag. But the cost of this increase doesn't stop there: Higher oil prices had a devastating effect on the economy.

Federal debt

There is no question that the Iraq war added substantially to the federal debt. This was the first time in American history that the government cut taxes as it went to war. The result: a war completely funded by borrowing. U.S. debt soared from $6.4 trillion in March 2003 to $10 trillion in 2008 (before the financial crisis); at least a quarter of that increase is directly attributable to the war. And that doesn't include future health care and disability payments for veterans, which will add another half-trillion dollars to the debt.

As a result of two costly wars funded by debt, our fiscal house was in dismal shape even before the financial crisis -- and those fiscal woes compounded the downturn.

The financial crisis

The global financial crisis was due, at least in part, to the war. Higher oil prices meant that money spent buying oil abroad was money not being spent at home. Meanwhile, war spending provided less of an economic boost than other forms of spending would have. Paying foreign contractors working in Iraq was neither an effective short-term stimulus (not compared with spending on education, infrastructure or technology) nor a basis for long-term growth.

Instead, loose monetary policy and lax regulations kept the economy going -- right up until the housing bubble burst, bringing on the economic freefall.

Saying what might have been is always difficult, especially with something as complex as the global financial crisis, which had many contributing factors. Perhaps the crisis would have happened in any case. But almost surely, with more spending at home, and without the need for such low interest rates and such soft regulation to keep the economy going in its absence, the bubble would have been smaller, and the consequences of its breaking therefore less severe. To put it more bluntly: The war contributed indirectly to disastrous monetary policy and regulations.

The Iraq war didn't just contribute to the severity of the financial crisis, though; it also kept us from responding to it effectively. Increased indebtedness meant that the government had far less room to maneuver than it otherwise would have had. More specifically, worries about the (war-inflated) debt and deficit constrained the size of the stimulus, and they continue to hamper our ability to respond to the recession. With the unemployment rate remaining stubbornly high, the country needs a second stimulus. But mounting government debt means support for this is low. The result is that the recession will be longer, output lower, unemployment higher and deficits larger than they would have been absent the war.

* * *

Reimagining history is a perilous exercise. Nonetheless, it seems clear that without this war, not only would America's standing in the world be higher, our economy would be stronger. The question today is: Can we learn from this costly mistake?

Joseph E. Stiglitz, a professor at Columbia University, was chairman of President Bill Clinton's Council of Economic Advisers and winner of the Nobel Prize in economics in 2001. Linda J. Bilmes is the Daniel Patrick Moynihan senior lecturer in public policy at Harvard University. They are co-authors of "The Three Trillion Dollar War: The True Cost of the Iraq Conflict."