US troops were poised to end a six-year presence on the streets of Iraq's towns and cities on Tuesday, a milestone in the country's recovery of sovereignty feted late into the night by tens of thousands in Baghdad.
The Iraqi government declared the day a national holiday but soldiers and police were out in force to prevent insurgent groups spoiling the party as Iraqi forces took sole charge of security in cities, towns and villages for the first time since the 2003 invasion.
"All Iraqis are happy today because it's the first day that they're going to protect themselves," said Baghdad civil defence spokesman Tahsin al-Sheikhli said. "We know that Iraq's enemies will attempt to disrupt security but our forces are ready to take them on."
In the wake of several massive bombings that have killed more than 200 people this month, all leave for security force personnel has been cancelled. Motorcycles, the favoured transport of several recent bombers, have been banned from the streets.
"Our expectation is that maybe some criminals will try to continue their attacks," interior ministry operations director Major General Abdul Karim Khalaf said.
"That is why orders came from the highest level of the prime minister that our forces should be 100 per cent on the ground until further notice."
On Monday, the former defence ministry building in the capital, taken over in the wake of the US-led invasion, was handed back to the Iraqi government.
"This marks the end of the rule of the multinational force," said General Abboud Qambar, the head of Baghdad Operation Command.
It was a landmark celebrated by huge crowds of revellers in Baghdad's largest park on Monday evening.
Popular Iraqi singers including Salah Hassan, Kassem Sultan and Abed Falek, who all live abroad, returned home for the celebration.
"Since 2003, I have never been to a party but today I am coming to hear the singers I love," Ahmed Ali, 20, told AFP.
Revellers had to undergo three security checks to enter the park but no one seemed to complain amid a jubilant atmosphere, where an onstage banner declared that Baghdad's sovereignty and independence had been recovered.
Even policemen joined in the fun, dancing with the party-goers.
"Today is the day that we got back our country," said Salim Mohammed, from the sprawling Shiite working-class district of Sadr City.
Prime Minister Nuri al-Maliki warned earlier this month that insurgent groups and militias were likely to step up attacks in the run-up to the June 30 deadline in a bid to undermine confidence in Iraq's own security forces.
There have been several large bombings since, the deadliest of which came near the northern oil hub of Kirkuk on June 20, when a truck loaded with explosives was detonated, leaving 72 people dead and more than 200 wounded.
The US military announced on Monday that a US soldier had died of injuries sustained in combat in Baghdad. A bomb in Sadr City on Sunday wounded three US soldiers, initial reports had said.
And a source close to Iraq's counter-terrorism office revealed that a truck loaded with 64 mortar rounds believed intended for use in sabotaging Tuesday's milestone had been intercepted in west Baghdad after successfully negotiating 11 roadblocks.
But Maliki and senior government officials have insisted that Iraq's 750,000 soldiers and police can defend the nation against attacks.
Only a small number of US forces in training and advisory roles will remain in urban areas, with the bulk of American troops in Iraq, 131,000 according to Pentagon figures, quartered elsewhere.
The June 30 withdrawal is the prelude to a complete American pullout by the end of 2011.
The Status of Forces Agreement, which set the pullback deadline, says US commanders must seek permission from Iraqi authorities to conduct operations, but American troops retain a unilateral right to "legitimate self-defence".