US Secretary of State Hillary Clinton warned Iran not to interfere in Iraq after the decision to pull all American troops out of the war-wracked neighboring state by the end of the year.

Clinton, on a visit to Tajikistan, echoed President Barack Obama’s comments that the United States would continue to work with Iraq despite the withdrawal of boots on the ground, but urged other states to be similarly constructive.

“To countries in the region, especially Iraq’s neighbors, we want to emphasize that America will stand with our allies and friends, including Iraq, in defense of our common security and interests,” she said.

The United States would continue to have a presence in the region, which “should be free from outside interference to continue on a pathway to democracy,” Clinton added, in a pointed reference to Iran.

Obama’s order for all US soldiers to leave Iraq will bring down the curtain on a divisive, bloody war that cost the lives of more than 4,400 American troops, tens of thousands of Iraqis and hundreds of billions of dollars.

Obama rose to power in opposing the unpopular conflict and pledged as a presidential candidate to withdraw all US military personnel, mindful that the occupation of Iraq had estranged the United States from its allies.

In his weekly radio address Saturday, Obama said his decision, coupled with the death of former Libyan leader Moamer Kadhafi, were reminders of “renewed American leadership in the world.”

Iraqi Prime Minister Nuri al-Maliki said the pullout would transform Baghdad’s ties with Washington, but he stressed that the “historic” withdrawal will not affect his country’s security and that any future American military training will be incorporated into arms deals.

Obama’s decision, announced at the White House on Friday, came after Iraq failed to agree to legal immunity for a small residual force that Washington had hoped to keep in the country to train the army and counter Iran’s influence.

President George W. Bush ordered the Iraq invasion in 2003, arguing that its then-leader Saddam Hussein was endangering the world with weapons of mass destruction programs, but after the dictator’s ouster, no such arms were found.

US troops soon became embroiled in a bitter insurgency, swelled by incoming Al-Qaeda fighters, and the tide of the war turned only after now retired General David Petraeus convinced Bush to mount a troop surge strategy in 2007.

The 39,000 remaining US troops in Iraq must pull out by December 31 under an accord signed between Washington and Baghdad in 2008 during the Bush presidency.

Obama, however, said US defense officials would still seek ways to help train Iraqi forces, as they do for many other nations, and US Defense Secretary Leon Panetta late Friday confirmed such a strategy.

“We now turn our full attention to pursuing a long-term strategic partnership with Iraq that’s based on mutual interest and mutual respect,” Panetta said.

But Republican presidential candidate Mitt Romney accused Obama of presiding over an “astonishing failure to secure an orderly transition in Iraq” which put at risk victories won through the sacrifice of American soldiers.

“The unavoidable question is whether this decision is the result of a naked political calculation or simply sheer ineptitude in negotiations with the Iraqi government,” he said.

Republican Senator Lindsey Graham, one of the staunchest supporters of the war, said he feared Obama’s decision would “set in motion events that will come back to haunt our country.”

While the US withdrawal reopens the question of whether Iraqi forces can safeguard the security gains made in recent years, Obama administration officials on Friday declined to say whether the war had been worthwhile.

“History is going to have to judge that,” said Vice President Joe Biden’s national security advisor Tony Blinken, who argued that vibrant politics in Iraq would be part of the US legacy.