BAGHDAD - U.S. forces formally marked the end of their mission in Iraq with a low-key ceremony near Baghdad on Thursday, after nearly nine years of war that began with the invasion to topple Saddam Hussein.
There are a little more than 4,000 U.S. soldiers in Iraq, but they will depart in the coming days, at which point almost no more American troops will remain in a country where there were once nearly 170,000 personnel 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 2003 U.S.-led invasion unleashed brutal sectarian fighting.
"Your dream of an independent and sovereign Iraq is now reality," U.S. Defense Secretary Leon Panetta said at the symbolic flag-lowering ceremony held near Baghdad's airport.
"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," he said.
But the U.S. "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," said Panetta.
"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."
He described the U.S. withdrawal as "nothing short of miraculous" and "one of the most complex logistical undertakings in U.S. military history."
Gen. Lloyd Austin, the commander United States Forces - Iraq (USF-I), cased the colors at the ceremony, rolling the USF-I flag around its pole and covering it with a camouflage bag.
He noted that "eight years, eight months and 26 days ago, as the assistant division commander for maneuver for the 3rd Infantry Division, I gave the order for the lead elements of the division to cross the border" into Iraq.
"I was here when we originally secured this airfield," he said.
The ceremony was also attended by U.S. ambassador to Iraq James Jeffrey, Gen. Martin Dempsey, the chairman of the Joint Chiefs of Staff, and Gen. James Mattis, the head of the U.S. Central Command, and about 160 U.S. soldiers.
Iraq was represented by military chief of staff Lt. Gen. Babaker Zebari and defense ministry spokesman Maj. Gen. Mohammed al-Askari.
"For over 20 years, Iraq has been a defining part of our professional and personal lives," said Dempsey.
"We will remember you and those that have gone before - what you risked, what you learned, how you sacrificed ... and the fallen comrades for whom we all still grieve."
The ceremony comes a day after hundreds of people in Fallujah marked the impending departure of American forces by burning U.S. flags and shouting slogans in support of the "resistance."
Fallujah, a city of about half a million people west of Baghdad, remains deeply scarred by two American military offensives in 2004, the latter of which is considered one of the fiercest for the United States since Vietnam.
Obama's predecessor, George W. Bush, ordered the invasion of Iraq in 2003, arguing Saddam was endangering the world with weapons of mass destruction programs.
Saddam was ousted from power and later executed, but such arms were never found.
Obama made his political career by opposing the war. In late 2002, he said he was against "dumb wars" such as Iraq, and rode anti-war fervor to the White House by promising to bring troops home.
The war was launched in March 2003 with a massive "shock and awe" campaign, followed by eight-plus years in which a U.S.-led coalition sought not only had to rebuild the Iraqi military from the ground up, but also to establish a new political system.
Iraq now has a parliament and regular elections, and is ruled by a Shiite-led government that replaced Saddam's Sunni-dominated regime.
The pullout, enshrined in a 2008 bilateral pact, is the latest stage in the changing U.S. 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.