BAGHDAD (AP) - After nearly nine years, 4,500 American dead, 32,000 wounded and more than $800 billion, U.S. officials formally shut down the war in Iraq - a conflict that U.S. Defense Secretary Leon Panetta said was worth the price in blood and money, as it set Iraq on a path to democracy.
Panetta stepped off his military plane in Baghdad Thursday as the leader of America's war in Iraq, but will leave as one of many top U.S. and global officials who hope to work with the struggling nation as it tries to find its new place in the Middle East and the broader world.
He and several other U.S. diplomatic, military and defense leaders participated in a highly symbolic ceremony during which the flag of U.S. Forces-Iraq was officially retired, or "cased," according to Army tradition.
The U.S. Forces-Iraq flag was furled - or wrapped - around a flagpole and covered in camouflage. It will be brought back to the United States.
"You will leave with great pride - lasting pride," Panetta told the troops. "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."
During several stops in Afghanistan this week, Panetta made it clear that the U.S. can be proud of its accomplishments in Iraq.
"We spilled a lot of blood there," Panetta said. "But all of that has not been in vain. It's been to achieve a mission making that country sovereign and independent and able to govern and secure itself."
That, he said, is "a tribute to everybody - everybody who fought in that war, everybody who spilled blood in that war, everybody who was dedicated to making sure we could achieve that mission."
Panetta echoed President Barack Obama's promise that the U.S. plans to keep a robust diplomatic presence in Iraq, foster a deep and lasting relationship with the nation and maintain a strong military force in the region.
As of Thursday, there were two U.S. bases and about 4,000 U.S. troops in Iraq - a dramatic drop from the roughly 500 military installations and as many as 170,000 troops during the surge ordered by President George W. Bush in 2007, when violence and raging sectarianism gripped the country. All U.S. troops are slated to be out of Iraq by the end of the year, but officials are likely to meet that goal a bit before then.
The total U.S. departure is a bit earlier than initially planned, and military leaders worry that it is a bit premature for the still maturing Iraqi security forces, who face continuing struggles to develop the logistics, air operations, surveillance and intelligence sharing capabilities they will need in what has long been a difficult neighborhood.
U.S. officials were unable to reach an agreement with the Iraqis on legal issues and troop immunity that would have allowed a small training and counterterrorism force to remain. U.S. defense officials said they expect there will be no movement on that issue until sometime next year.
Still, despite Obama's earlier contention that all American troops would be home for Christmas, at least 4,000 forces will remain in Kuwait for some months. The troops will be able to help finalize the move out of Iraq, but could also be used as a quick reaction force if needed.
Obama met in Washington with Iraqi Prime Minister Nouri al-Maliki earlier this week, vowing to remain committed to Iraq as the two countries struggle to define their new relationship. Ending the war was an early goal of the Obama administration, and Thursday's ceremony will allow the president to fulfill a crucial campaign promise during a politically opportune time. The 2012 presidential race is roiling and Republicans are in a ferocious battle to determine who will face off against Obama in the election.
Panetta acknowledged the difficulties for Iraq in the coming years, as the country tries to find its footing.
"They're going face challenges in the future," Panetta said Wednesday during a visit with troops in Afghanistan. "They'll face challenges from terrorism, they'll face challenges from those that would want to divide their country. They'll face challenges from just the test of democracy, a new democracy and trying to make it work. But the fact is, we have given them the opportunity to be able to succeed."
The ceremony at Baghdad International Airport also featured remarks from Army Gen. Martin Dempsey, the chairman of the Joint Chiefs of Staff, and Gen. Lloyd Austin, the top U.S. commander in Iraq.
Austin is leading the massive logistical challenge of shuttering hundreds of bases and combat outposts, and methodically moving more than 50,000 U.S. troops and their equipment out of Iraq over the last year - while still conducting training, security assistance and counterterrorism battles.
Over the coming days, the final few thousand U.S. troops will leave Iraq in orderly caravans and tightly scheduled flights - a marked contrast to the shock and awe that rocked the country on March 20, 2003, as the U.S. invasion began.
Saddam Hussein has been ousted, the reports of weapons of mass destruction largely laid to rest. And the future of a nascent democracy awaits.