“THE LONG WAR in Iraq will come to an end by the end of this year,” President Obama announced on Friday afternoon. That will be true only for American soldiers. Iraqi insurgents, including al-Qaeda, continue to wage war against the country’s fragile democratic government; Iran sponsors its own militias and has been accelerating its effort to dominate its neighbor. Thousands of private contractors will continue to guard U.S. diplomats and installations. And a tense standoff goes on between ethnic Kurdish and Iraqi government forces in northern Iraq — where Turkey has just launched its own armed incursion.

It could be, as White House officials argued, that the government of Nouri al-Maliki and its armed forces can manage all these threats without help or training from American soldiers, who have already played a secondary role since the end of combat operations last year. But Mr. Obama’s decision to carry out a complete withdrawal sharply increases the risk that painfully won security gains in Iraq will come undone; that Iran will be handed a crucial strategic advantage in its regional cold war with the United States; and that a potentially invaluable U.S. alliance with an emerging Iraqi democracy will wither.

Mr. Obama portrayed the complete pullout of the 43,000 remaining U.S. forces as the product of “full agreement” with Mr. Maliki, whom he invited to Washington in December to work on a future partnership. In fact, both governments were internally divided. The majority of Iraqi leaders sought a continued U.S. troop presence as a check on Iran and a guarantor of a strong alliance — just like other American allies in the Persian Gulf. But Mr. Maliki found it hard to face down the Iranian-backed party in his government; he eventually brokered a bad compromise under which Iraq proposed that U.S. training forces remain but be denied the legal immunity the Pentagon insists on elsewhere in the world.

That gave Mr. Obama a ready reason to side with White House advisers who had argued against a stay-on force all along. U.S. military commanders, with an eye on Iran, had planned for a troop contingent of up to 18,000. But civilian aides argued that U.S. and Iraqi security forces have demonstrated the ability to maintain control even as U.S. forces have pulled back; that Iraqis have resisted Iranian meddling and will continue to do so; and that the political system now works well enough to prevent a return to the sectarian warfare that raged before 2007. Washington, they say, has the means to maintain influence through its arms sales to Iraq and the trainers who will accompany them — not to mention a U.S. embassy that will be among the largest in the world.

The next year or two will show whether that calculation is correct. In the meantime Mr. Obama will surely boast on the campaign trail, as he did Friday at the White House, that he has fulfilled his 2008 pledge “to bring the war in Iraq to a responsible end.” End it will, for Americans if not for Iraqis; as for “responsible,” count us among the doubters.