Eight years and three months after "liberating Iraq", a time of unrelenting savage strife in which tens of thousands died and a society was torn apart, America has formally ended its war in Iraq.
After the colours of the US forces were lowered and the "Last Post" was played, Defence Secretary Leon Panetta told troops: "You will leave with great pride, lasting pride, secure in knowing that your sacrifice has helped the Iraqi people to cast tyranny aside and to offer hope for prosperity and peace to this country's future generations."
The ceremony, just 48 minutes long to limit the scope of any possible attack, was held behind high, fortified walls in a concrete courtyard at the airport in Baghdad. "We spilled a lot of blood here," Mr Panetta acknowledged. But, he insisted: "It has been to achieve a mission making the country sovereign and independent and able to govern and secure itself."
Not far from where the speeches were taking place lay grim evidence which refuted the claims that the Americans were leaving behind a land of stability and prosperity. More than 8,000 people are living in squalor in a field of mud and foetid water, with huts made of rags and salvaged pieces of wood.
The residents of Al-Rahlat camp are among 1.3 million refugees in their own country; families driven out of their homes by the sectarian violence spawned by the war. Another 1.6 million fled Iraq for neighbouring states, mainly Jordan and Syria. Those in Syria, with its escalating violence, are now having to seek another place of safety.
There is a third group who are particularly vulnerable – around 70,000 people who worked for the US military. They were promised the offer of refuge in the US, but little has been done fulfil the pledge. Barack Obama, while campaigning for the White House four years ago, berated the Bush administration over the issue, saying: "The Iraqis who stood with us are being targeted for assassination, yet our doors are shut. That is not how we treat our friends." In 2008 Congress passed a bill for special immigration visas to be issued for 25,000, but only 3,000 have been processed during Obama's presidency.
Around 450,000 of the IDPs (internally displaced persons) are living in the worst conditions, crammed into 380 street settlements scattered around the country. They have little or no access to clean water, sanitation or medical care. Many of these people, deemed to be illegally squatting, cannot get the documents necessary to register for welfare relief or take up jobs, or enrol their sons and daughters in schools. The tension and claustrophobia of such an existence has led to psychological problems, especially among children. Domestic violence is rife.
Hakim al-Ibrahimi, a 47-year-old unemployed bricklayer, has been stuck at Al-Rahlat camp, in the Shia enclave of Sadr City, for the past two years with his wife and four children. "I was staying with my brother and his family. But there were 11 of us in a flat with two bedrooms, it became impossible," he said.
"Officials tell us to go back to our home. But what home? We used to live in Adhamiya [a mainly Sunni area] and we had to escape otherwise we would have been killed. That was four years ago and I know someone else is living in my house with his family. Life here is really bad, but if we go back to Adhamiya we won't be safe."
The turbulence of Iraq's recent history had taken its toll on Amal's family (not her real name). Her husband was killed in the war with Iran and a son, Akram, was executed by Saddam Hussein's regime after joining the underground opposition. A second son, Mazruq, died in a sectarian attack. Amal lives at a camp with her daughter, Radwa, and three grandchildren. She has not received compensation under a scheme set up by the Iraqi government for civilian victims of the war.
The International Rescue Committee, which provides humanitarian assistance, has taken up the case of Amal and dozens of others. The IRC said: "As the US government withdraws its troops, it leaves behind a major crisis in the region. The US has a responsibility to aid Iraqis uprooted by war it started and to protect the most vulnerable."
Laura Jacoby, with the IRC in Baghdad, said: "The main worry is that with the US forces leaving, international donors may go as well. The Iraqi government is organising assistance, but we face a very serious problem inside Iraq and in Syria and Jordan as well."
Case study: The Hayali family
What happened to Mohammed and Nadia al-Hayali, a decent couple bringing up two young children in Baghdad when US and British forces invaded, is a poignant illustration of how lives were destroyed in the unleashed violence.
I met them in 2004, 18 months after George Bush had declared "mission accomplished". Although the insurgency was already under way, with dead bodies turning up in the streets, relentless bombings and power cuts, the Hayalis hoped that peace would eventually prevail.
Nadia, 39, a Shia, and Mohammed, 40, a Sunni, lived in al-Jamiya, a "mixed" middle-class neighbourhood, where previously sectarian labels did not matter.
A year later things had changed for the worse. Suicide bombings were a daily occurrence, death squads roamed the streets and kidnappings had become common. My visit to their home had to be carefully planned. Groups of men in dark glasses cruised around in Audis and BMWs; they were insurgents looking for US or security convoys.
The middle-class exodus from Iraq was under way. The Hayalis, like many, decided to go. "What is left now? The place is destroyed. That is what liberation had done to us," said Mohammed.
He did not make it. A little later Nadia, Mohammed, their 10-year-old son Abdullah and daughter Dahlia, eight, were taken away by Sunni gunmen looking for "collaborators".
Mohammed was raising funds for small businesses and this brought him into contact with government officials. He was executed with a bullet to his head. Nadia now lives in Sweden with her children.
Iraq by numbers...
79 Percentage of homes with 'bad' or 'very bad' power supply.
2.4 The degree of confidence – on a scale of 0 to 10 – that Iraqi households have in foreign forces.
30 Percentage of Iraqi homes with access to the public sanitation system.
Source: UNDP Iraq