Washington: President Barack Obama heralded the end of the divisive Iraq war on Tuesday, and warned Iraq's neighbours that the United States would remain a major player in the region even as it brings its troops home.

"Our strong presence in the Middle East endures," Obama said. "And the United States will never waver in the defence of our allies, our partners and our interests."

Speaking after a morning of meetings with Iraqi Prime Minister Nouri al-Maliki, Obama said other nations must not interfere with Iraq's sovereignty.

While he stopped short of mentioning any countries by name, US officials are closely watching how neighbouring Iran may seek to influence Baghdad after US troops withdraw.

Early signs of how Iraq may orient itself could come from how it handles troubles in Syria, where the United Nations says 4,000 people have been killed in a government crackdown on protesters.

While Obama has called for Syrian President Bashar Assad to step down, Iraq has been more circumspect, with al-Maliki warning of civil war if Assad falls and abstaining from Arab League votes suspending Syria's membership and imposing sanctions.

Those positions align Iraq more closely with Iran, a key Syrian ally.

Obama said he and al-Maliki were both deeply concerned by the Syrian government's assault on its own people. And Obama said he was confident that the Iraqi leader's approach to dealing with Syria was based on his own nation's interests.

"Even if there are tactical disagreements I have no doubt those decisions are made based on what's best for Iraq, no considerations of what Iran would like to see," Obama said.

Al-Maliki's trip to Washington came as the last American troops were preparing to leave Iraq ahead of a December 31 deadline.

Just 6,000 US forces remain, down from a high of 170,000 at the war's peak in 2007.