The US military officially ended its war in Iraq on Thursday, rolling up its flag at a low-key ceremony with Defense Secretary Leon Panetta nearly nine bloody years after the invasion that ousted Saddam Hussein.
"After a lot of blood spilled by Iraqis and Americans, the mission of an Iraq that could govern and secure itself has become real," Panetta said at the ceremony outside Baghdad's heavily-fortified airport.
Almost 4,500 US soldiers and tens of thousands of Iraqis lost their lives in the war that began with a "Shock and Awe" campaign of missiles pounding Baghdad, but descended into sectarian strife and a surge in US troop numbers.
US soldiers rolled up the flag of American Forces in Iraq and slipped it into a camouflage-colored sleeve in a brief ceremony, symbolically ending the most unpopular US military venture since the Vietnam War of the 1960s and 70s.
The remaining 4,000 American troops will withdraw by the end of the year, leaving behind a country still tackling a weakened but stubborn Islamist insurgency, sectarian tensions and political uncertainty.
“Iraq will be tested in the days ahead, by terrorism, by those who would seek to divide, by economic and social issues," Panetta told the rows of assembled US soldiers and embassy officials at the ceremony. "Challenges remain, but the United States will be there to stand by the Iraqi people."
Iraq's neighbors will watch how Baghdad tackles its problems without the US military, while a crisis in neighboring Syria threatens to upset the region's sectarian and ethnic balance.
US President Barack Obama, who made an election promise to bring troops home, told Iraqi Prime Minister Nuri Al-Maliki that Washington will remain a loyal partner after the last troops roll across the Kuwaiti border.