The ceremony was also attended by General Lloyd Austin, the commander of U.S. forces in Iraq, General Martin Dempsey, the chairman of the Joint Chiefs of Staff and James Jeffrey, the U.S. ambassador to Baghdad, along with Iraqi military's chief of staff Lieutenant General Babaker Zebari and defense ministry spokesman Major General Mohammed al-Askari.
Iraqi soldiers have photos taken during a ceremonial handover of Camp Echo in Diwaniya, Iraq, Dec. 14, 2011. (Xinhua/Zhang Ning)
"This is now an Iraq with whom the U.S. will continue to work with in every way possible," Jeffery said, after the U.S. troops cased their flag.
Panetta, who arrived earlier in Baghdad to mark the ceremony that ends U.S. military operations in Iraq, said that "Your dream of an independent and sovereign Iraq is now a reality."
"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," Panetta warned.
He pledged that his country "will continue to help Iraq address violent extremism and defend against external threats. We will continue to have a robust and enduring military presence across the Middle East."
"Today, some five years later, and 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, adding that "the Iraqi army and police have been rebuilt. Violence levels are down. Al-Qaida weakened. Rule of law strengthened. Educational opportunities expanded, and economic growth expanding."
Panetta hailed his troops' sacrifices in Iraq, saying "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."
"This is an opportunity for Iraq to forge ahead on a path to security and prosperity," he said.
For his part, Austin recalled in his speech the time when he gave orders for his troops to cross the border in to Iraq in 2003, saying that he will now see his troops leave the country.
Panetta is scheduled to meet with Iraqi top officials to discuss fully withdrawal of U.S. troops from the country.
This is Panetta's second visit to Iraq since he took office as the U.S. defense secretary.
According to a security pact named Status of Forces Agreement ( SOFA) signed in 2008 between the United States and Iraq, all the U. S. troops are scheduled to pull out of Iraq by the end of 2011.