WASHINGTON — Secretary of State Hillary Clinton warned Iran on Sunday not to "miscalculate" in Iraq, saying the US military presence in the region would remain strong after the withdrawal of all American combat forces at the end of the year.

"No one, most particularly Iran, should miscalculate about our continuing commitment to and with the Iraqis going forward," she said in an interview with CNN from Uzbekistan.

Iraq refused to give legal immunity to a small residual force that Washington had hoped to leave behind, leading President Barack Obama to announce Friday that all 39,000 US combat troops in Iraq would be out of Iraq by the end of the year.

The withdrawal, a key Obama promise, drew fire from conservatives in Washington who called it a victory for Iraq, and was welcomed in Tehran as long overdue.

President Mahmoud Ahmadinejad was asked by CNN in an interview on its "GPS with Fareed Zakaria" show whether Iran would take over the training and support of the Iraqi military once the Americans were gone.

He said Iran had "special relations" with Iraq but its government "should decide how to provide training for the military personnel. We should wait for a decision of the Iraqi government."

Played a clip from the Ahmadinejad interview, Clinton said, "I'm used to the president of Iran saying all kinds of things, but I think it's important to set the record straight."

Clinton said the US military would continue to train, arm and support the Iraqi military after the US withdrawal, and that the United States would maintain a robust diplomatic presence to manage the relationship.

"In addition to a very significant diplomatic presence in Iraq which will carry much of the responsibility for dealing with an independent, sovereign, democratic Iraq, we have bases in neighboring countries, we have our ally in Turkey. We have a lot of presence in that region," she said.

However, US Defense Secretary Leon Panetta said Friday that the training mission must still be negotiated with the Iraqis, whose Shiite-led government is close to Iran and has had a torturous relationship with Washington.

US conservatives, meanwhile, attacked the pullout as leaving the door open to Iran.

Senator John McCain called it "a serious mistake. I believe we could have negotiated an agreement. And I'm very, very concerned about increased Iranian influence in Iraq."

Interviewed on ABC's "This Week" from Amman, Jordan, McCain said Obama's announced withdrawal "is viewed in the region as a victory for the Iranians. And I don't think there's any doubt there is."

Senator Lindsey Graham, another influential Republican, took Obama to task on Fox News Sunday for what he said were "dangerous" policy decisions on Iraq that ignored military recommendations that up to 18,000 troops be kept there next year.

"He's putting in question our success in Afghanistan and he ended Iraq poorly, fumbled the ball inside of the tent. I hope I'm wrong about what happens in Iraq, but they are dancing in the streets in Tehran."

Clinton came to Obama's defense in a separate interview on Fox News Sunday, praising his "smart leadership in a complex world."

Clinton lauded Obama, her former rival, for making the call to send US special forces to kill Al-Qaeda leader Osama bin Laden inside Pakistan, and for forging the coalition that ousted Libyan dictator Moamer Kadhafi.

Asked what foreign policy principle guided Obama to intervene in Uganda and Libya but not in Syria, Clinton responded: "I think it's important that in this very complex, dangerous world, we have somebody in the White House who understands that America has to lead.

"Our leadership is essential. But we have to look at every situation and make the right decision."