Secretary of Defense Leon Panetta presided over a muted ceremony in Baghdad yesterday marking the end of the U.S. military mission in Iraq. He proclaimed that the United States had achieved its goal of establishing “an Iraq that could govern and secure itself.” But he warned that “Iraq will be tested in the days ahead—by terrorism, and by those who would seek to divide it.”

Unfortunately, the Obama Administration’s failure to negotiate an extension of the U.S. military presence past the December 31 deadline set by the 2008 status of forces agreement means that the Iraqi government will be in a much weaker position to fight terrorism and prevent the resumption of a sectarian civil war. The sudden withdrawal of substantial U.S. military, intelligence, logistical, and training support will undermine the capabilities of Iraq’s security forces.

The end of the U.S. military presence will also make it more difficult to contain Iran’s influence inside Iraq. One of the first tests will be resolving the status of Ali Musa Duqduq, a Lebanese commander of the Hezbollah terrorist group who was apprehended and jailed by U.S. forces after he led a terrorist attack that killed five American servicemen in Iraq in 2007. If the Obama Administration turns him over to the Iraqi government, then he is sure to be quickly released and given a hero’s welcome in Iran and Lebanon.

Heritage Foundation senior legal fellow Charles “Cully” Stimson and David Rivkin wrote an op-ed in The Wall Street Journal that denounced this possible outcome as a “triumph of ideology over national interest and honor.” The two legal scholars instead recommend that the terrorist be transferred to Guantanamo Bay to be tried by a military commission. This would serve the cause of justice, deprive Iran of the services of a dangerous terrorist, and make Iraq a safer place.

The Obama Administration has played down the security risks in Iraq as part of its effort to claim political credit for ending the U.S. military role there. The Administration contends that the end of the military mission is a triumph for the President’s vision of foreign policy. In fact, the Iraq war effort was put on a glide path toward success by the Bush Administration, which courageously ordered a troop surge and change of strategy in 2007, when many critics claimed that the war was already lost.

Ironically, the surge was opposed by Senators Barack Obama, Joe Biden, and Hillary Clinton, who now claim credit for withdrawing from a stabilized Iraq.