In declaring the official end to the war, U.S. Defense Secretary Leon Panetta recognized a "independent, free and sovereign Iraq," The Washington Post reported.
"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 told dignitaries and military personnel. "To be sure, the cost was high -- in blood and treasure for the United States and for the Iraqi people. Those lives were not lost in vain."
Meanwhile, the White House invited members of the public to write a note and post it online at whitehouse.gov/iraq to honor Iraq veterans.
"As we mark the end of this war, we need to show our veterans and their families that they have the thanks of a grateful nation," President Barack Obama said on the White House Web site.
"In America, our commitment to those who fight for our freedom and our ideals doesn't end when our troops take off the uniform," the president said. "You can be a part of this effort to honor our heroes. Help mark this moment. Write a quick note that troops and veterans all over the world will be able to see."
In Baghdad, the ceremony essentially ended the war two weeks earlier than the Dec. 31 deadline stipulated in the security agreement signed by the U.S. and Iraqi governments in 2008. The date of the ceremony had been kept secret to prevent a possible attack by insurgents or militias, the Post said.
Before Panetta spoke, the white flag of the United States Force-Iraq was lowered, folded and cased, ending the U.S. military's mission eight years, eight months and 25 days after it began.
"No words, no ceremony can provide full tribute to the sacrifices which have brought this day to pass," Panetta said. "I'm reminded of what President Lincoln said in Gettysburg, about a different war, in a different time. His words echo through the years as we pay tribute to the fallen in this war: 'The world will little note, nor long remember, what we say here, but it can never forget what they did here.'"
Panetta recognized U.S. Ambassador James Jeffrey and Army Gen. Lloyd Austin, commander of U.S. forces in Iraq, for overseeing the withdrawal of 50,000 troops in recent months and the closure of dozens of bases. He also paid tribute to the more than 1 million U.S. troops who have served in Iraq since 2003, including about 4,487 who were killed and 30,000 wounded.
"You have done everything your nation has asked you to do and more," he said.
"You will leave with great pride, lasting pride," Panetta said, "secure in knowing that your sacrifice has helped the Iraqi people begin a new chapter in history free from tyranny and full of hope for prosperity and peace."
He also recognized military families who "withstood the strain" of uncertainty and multiple deployments.
"Together with the Iraqi people," he added, "the United States welcomes the next stage in U.S.-Iraqi relations."
All U.S. troops must be withdrawn from Iraq by the end of December after Washington and Baghdad failed to agree on terms under which they could remain. About 5,500 American troops were in Iraq as of Tuesday, the most recent day for which figures were available, CNN said.
Celebrity Breakups and divorces of 2014 [PHOTOS]