US Secretary of State Hillary Clinton on Saturday implicitly warned Iran not to interfere in Iraq after the decision to pull all American troops out of the war-wracked 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 a complete military withdrawal, but urged neighboring 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, alluding to US arch-foe Iran.

Washington has frequently accused Shiite militant groups in Iran of committing attacks in Iraq, and US officials routinely criticize Tehran for interfering in the affairs of Baghdad's Shiite-led government.

Obama's order for all US soldiers to leave Iraq by December 31 will end a divisive and 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 no such arms were found after the dictator's ouster.

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 by the end of 2011 under an accord signed between Washington and Baghdad during the Bush presidency.

Obama 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.

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.