U.S. Defense Secretary Leon Panetta addressed the remaining U.S. troops in Baghdad.
He and other U.S. leaders participated in a symbolic ceremony, during which the flag of U.S. Forces-Iraq was officially retired.
He says was worth the cost in blood and dollars, as it set Iraq on a path to democracy. He told all U.S. troops, "your nation is deeply indebted to you."
Panetta arrived 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 seeks its new place in the Middle East and the world.
The U.S. invaded Iraq in March 2003. The final few thousand troops will be out of the country by year's end.