Media playback is unsupported on your device Media caption President Barack Obama: "The Iraqi people now have lead responsibility for the security of their country"

President Barack Obama has hailed the end of US combat operations in Iraq, saying his country has paid a "a huge price" to "put Iraq's future in its people's hands".

In a rare Oval Office address, he said he had been "awed" by the sacrifice of the US military.

But he said America's "most urgent task" was now to "restore our economy".

The US has marked the change in a ceremony in Baghdad, attended by Vice-President Joe Biden.

The outgoing US military commander, Gen Raymond Odierno, handed over to Gen Lloyd Austin, who will be in charge of the 50,000 troops remaining in the country to "advise and assist" Iraqi forces.

"American engagement with Iraq will continue with the mission that begins today - Operation New Dawn," Mr Biden said.

"As the name suggests, this ceremony not only marks the change of a command, but the start of a different chapter in the relationship with Iraq."

The vice-president later told CBS News that he believed Iraqi politicians were "close" to agreeing on forming a new coalition government, nearly six months after March's election produced no conclusive winner.

"I've met with every one of the groups that won portions of the vote in the elections and I'm absolutely convinced that they are nearing the ability of forming a government, that will be a government representing the outcome of the election which was very much divided," he added.

Turning the page

In his televised address to the nation on Tuesday, President Obama said the US would continue to support Iraq's government and people.

Media playback is unsupported on your device Media caption US Vice-President Joe Biden spoke at a handover ceremony in Baghdad

"Operation Iraqi Freedom is over, and the Iraqi people now have lead responsibility for the security of their country," Mr Obama said.

The BBC's Paul Adams in Washington says he may want to concentrate on the issues that really matter to his electorate - those that will influence voters in critical midterm elections in two months' time.

But the president knows he is going to be a war-time president for some time to come, our correspondent adds.

In his speech, Mr Obama said: "The US has paid a huge price to put the future of Iraq in the hands of its people.

"We have sent our young men and women to make enormous sacrifices in Iraq, and spent vast resources abroad at a time of tight budgets at home... Through this remarkable chapter in the history of the US and Iraq, we have met our responsibility. Now, it is time to turn the page."

Rhetorical flourishes might have been out of place in any case. This was unadorned with soaring words though not lacking in strategy Read Mark's thoughts in full

Mr Obama said he had spoken earlier in the day to former President George W Bush, who led the US into war and was accused of mishandling the subsequent occupation.

"It's well known that he and I disagreed about the war from its outset," Mr Obama said.

"Yet no one could doubt President Bush's support for our troops, or his love of country and commitment to our security. As I have said, there were patriots who supported this war, and patriots who opposed it. And all of us are united in appreciation for our servicemen and women, and our hope for Iraq's future."

Mr Obama said the drawdown in Iraq allowed the US military to divert resources to the fight in Afghanistan, where he said the US remained committed to defeating al-Qaeda and the Taliban.

But he reiterated the mission in that country would last "a limited time" before Afghan security forces would have to take over.

Iraq War Timeline 2003 - Saddam Hussein captured; No WMDs found; Insurgency builds

2004 - Attacks on Shia shrines inflame sectarian tensions; Abu Ghraib abuse scandal; Transition government formed

2005 - Elections favour Shia and Kurds; Sunnis refuse to back constitution; Violence rages

2006 - Samarra attack inflames sectarian violence; Al-Qaeda leader Abu Musab al-Zarqawi killed; Sadr City bombs kill 200; Saddam hanged

2007 - President Bush's troop "surge"; Blackwater shootings; UK hands Basra to Iraqi forces

2008 - Sunni bloc rejoins government; Iraqis battle Sadr militia in Basra; US hands over Anbar; pact for US troops to leave by end of 2011

2009 - Provincial elections held; US forces leave towns and cities; Hundreds killed in Baghdad attacks

2010 - Political vacuum after parliamentary election; US combat troops withdraw; 50,000 remain in Iraq

"As was the case in Iraq," he said, "we cannot do for Afghans what they must ultimately do for themselves."

The withdrawal of combat troops from Iraq came despite continuing violence and instability there.

Speaking earlier on Tuesday, Iraqi Prime Minister Nouri Maliki lauded the US withdrawal, saying Iraq was now "sovereign and independent".

"Our security forces will take the lead in ensuring security and safeguarding the country and removing all threats that the country has to weather, internally or externally," he said.

Violence in Iraq is down from the peak seen during the sectarian conflict in 2006-2007, although the number of civilian deaths rose sharply in July.

While many Iraqis have welcomed the withdrawal, others say they believe it is happening too soon and that the country is not ready to manage its own security.

The last US combat brigade left Iraq nearly two weeks ago, well ahead of the 31 August target set by President Obama to cut the number of US troops in Iraq below 50,000.

All US forces must be gone by the end of next year.