US military personnel in Baghdad lower the US Forces-Iraq colours before they are encased, during a flag-lowering ceremony marking the end of the US mission in Iraq on December 15 nearly nine years after the controversial invasion to topple Saddam Hussein.
US forces formally marked the end of their mission in Iraq with a low-key ceremony near Baghdad on Thursday, after nearly nine years of divisive war that began with the invasion to oust Saddam Hussein.
The "casing of the colours" near the airport, the first site the US occupied in Baghdad in 2003, comes with around 4,000 US soldiers still in Iraq, all of whom will depart in the coming days.
At that point almost no American troops will remain in a country where there were once nearly 170,000 on more than 500 bases.
The withdrawal ends a war that left tens of thousands of Iraqis and nearly 4,500 American soldiers dead, many more wounded, and 1.75 million Iraqis displaced, after the US-led invasion unleashed brutal sectarian fighting.
"After a lot of blood spilled by Iraqis and Americans, the mission of an Iraq that could govern itself has become real," US Defence Secretary Leon Panetta said at the symbolic flag-lowering ceremony.
"Iraq will be tested in the days ahead -- by terrorism and by those who would seek to divide it, by economic and social issues, by the demands of democracy itself," Panetta said.
But the US "will stand by the Iraqi people as they navigate those challenges".
"This is a time for Iraq to look forward. This is an opportunity for Iraq to forge ahead on a path to security and prosperity," he said.
"And we undertake this transition today reminding Iraq that it has in the United States a committed friend and partner. We owe it to all of the lives that were sacrificed in this war not to fail."
Panetta described the US withdrawal as "nothing short of miraculous" and "one of the most complex logistical undertakings in US military history."
It brings to an end nearly nine years of US military involvement in Iraq, beginning with a "shock and awe" campaign in 2003 that many in Washington believed would see US forces conclude their mission in Iraq within months.
Instead, a bloody Sunni Arab insurgency led to widespread communal bloodshed, with more than 100,000 Iraqi civilians reported killed in the years since the invasion, according to British NGO Iraq Body Count.
That was only quelled when then-president George W. Bush ordered a "surge" of American troops to Iraq, and Sunni tribal militias sided with US forces against Al-Qaeda.
"A lot of us feel like we haven't done a whole lot of good," said Sergeant Teddy Loftis, one of the 160-odd soldiers seated for the ceremony. "We accomplished our mission, but we don't feel like we've won.
"There's still terrorists here, there's still Al-Qaeda here.
"(We are) happy to go home, but a little disappointed in how it's ending."
The ceremony was also attended by US ambassador to Iraq James Jeffrey, General Martin Dempsey, the chairman of the Joint Chiefs of Staff, General James Mattis, the head of US Central Command, and General Lloyd Austin, the commander of US forces in Iraq.
Iraq was represented by armed forces chief of staff Lieutenant General Babaker Zebari and defence ministry spokesman Major General Mohammed al-Askari.
The pullout, enshrined in a 2008 pact, is the latest stage in the changing US role in Iraq, from 2003-2004 when American officials ran the country to 2009 when the United Nations mandate ended, and last summer when Washington officially ended combat operations.
It leaves Iraq with a 900,000-strong security force that many believe, while capable of maintaining internal security, is unable to defend its borders, air space and maritime territory.
Some US observers also fear a return to bloody sectarianism, doubt the strength of Iraq's political structures, and feel that Prime Minister Nuri al-Maliki, who hails from the Shiite majority, has entrenched his power base to the detriment of the country's minorities.
Thursday's ceremony comes a day after US President Barack Obama honoured America's "bleeding and building" in Iraq, hailing the "extraordinary achievement" of a war he once branded "dumb".
"It is harder to end a war than to begin one," Obama said. "One of the most extraordinary chapters in the history of the American military will come to an end. Iraq's future will be in the hands of its people. America's war in Iraq will be over."
On the same day, hundreds of people in Fallujah, site of two of the fiercest battles of the Iraq war, marked the impending departure of American forces by burning US flags and shouting slogans in support of the "resistance."
Obama's predecessor Bush ordered the invasion of Iraq in 2003, arguing Saddam was endangering the world with weapons of mass destruction programmes. Saddam was ousted from power and later executed, but such arms were never found.