Iraqi forces were in control of towns and cities nationwide after the pullout of US troops six years after the invasion, but a bloody car bombing underscored the tough challenge ahead.
US President Barack Obama, who opposed the 2003 war ordered by his predecessor George W. Bush, hailed the US withdrawal as an "important milestone" but warned of difficult days of bloodshed and violence ahead.
The landmark day was marred by a bomb attack on a popular market in Kirkuk, an oil hub which has long been riven by ethnic tensions, which left 33 people dead and 92 wounded including women and children.
"The explosion occurred at a very busy time. I only saw fire and my stall was thrown over. I saw traders on fire in their shops and there were dead and wounded people on the ground," said Aras Omar Ghaffour, a 28-year-old vegetable stallholder.
Iraq marked the American pullback with a national holiday six years after the invasion that toppled Saddam Hussein but sparked an insurgency and sectarian bloodshed that left tens of thousands dead.
American troops were to have quit built-up areas by midnight (2100 GMT), ahead of a complete pullout ordered by Obama by the end of 2011.
Iraqi Prime Minister Nuri al-Maliki took on critics of Iraq's army and police, saying they were up to the task of taking over from the Americans.
"It is an offence to the Iraqis. The people who said that the foreign troops would never withdraw and would keep permanent bases in our country were giving a green light to the terrorists to kill civilians," he said.
The US military said four soldiers died from combat-related injuries on Monday, taking to 4,321 the number of American troops killed since the invasion.
"Make no mistake, there will be difficult days ahead. We know that the violence in Iraq will continue; we see that already in the senseless bombing in Kirkuk earlier today," Obama said at the White House.
|Iraqi civilians and security celebrate on the streets of the southern city of Basra.|
"This is an important step forward, as a sovereign and united Iraq continues to take control of its own destiny," he said, adding that Iraqi leaders now had to make "hard choices" to resolve political issues and bolster security.
"Today's transition is further proof that those who have tried to pull Iraq into the abyss of disunion and civil war are on the wrong side of history."
Maliki had warned earlier this month that insurgent groups and militias were likely to step up attacks in the run-up to June 30 in a bid to undermine confidence in Iraq's own security forces, despite an overall fall in violence.
The deadliest attack this year occurred near Kirkuk on June 20 when 72 people were killed.
US Defence Secretary Robert Gates said Tuesday he expects "sporadic attacks" as Al-Qaeda fighters "increase the level of violence to try to pretend that they forced us out of the cities" and show weakness in the Iraqi forces.
The top US commander General Ray Odierno told US reporters in a video briefing from Baghdad that he believed Iraq was now better off "not having a dictator such as Saddam Hussein.
"They are now going to be able to see that they can move ahead and the people of Iraq will have a say in their government."
But he declined to say how many US troops would be left in urban centres, saying that figure "will be different every single day," adding that the remaining US troops would be acting as trainers and advisers.
Tuesday's pullback was part of a security agreement signed in November setting the terms for a continued US military presence in Iraq, where there are currently about 133,000 American troops.
Across Baghdad, tanks and armoured vehicles manned by Iraqi soldiers and police and decorated with artificial flowers, flags and banners passed through the city, as nationalistic songs and popular music played.
The Status of Forces Agreement, which set the pullback deadline, says US commanders must now seek Iraqi permission to conduct operations, but their troops retain a unilateral right to "legitimate self-defence."