|The 'US Forces-Iraq' flag was furled and 'cased', and will be flown back to the United States to be retired [Al Jazeera]
US defence chief Leon Panetta has officially ended the US's military presence in Iraq by saying that "the dream of an independent and sovereign Iraq is now a reality" at a ceremony at the US military headquarters in Baghdad.
Thursday's flag-casing ceremony in the Iraqi capital came ahead of the final withdrawal of all US troops from the country by the end of the year, prompting celebrations for many Iraqis but also uncertainty regarding the stability of the country.
Nearly nine years after the start of the controversial invasion that toppled Saddam Hussein and sparked years of violence, Panetta told Iraqis "Your children will have a better future", and said the US and Iraq would have "a new relationship rooted in mutual interest and mutual respect".
"We are not about turn our backs on all that has been sacrificed and accomplished in Iraq," Panetta said.
"Iraq will be tested in the days ahead by terrorism, by those who would seek to divide, by economic and social issues ... by the demands of democracy itself," he said, while adding that the US would be a "committed friend and ... partner" to the country.
'Source of inspiration'
General Lloyd Austin, the commander of US forces in Iraq, said that the country would be "a source of stability and inspiration in the region".
|Follow in-depth coverage of the nation in flux
Panetta and Austin were joined at the ceremony by US Ambassador to Iraq James Jeffrey, Chairman of the US Joint Chiefs of Staff General Martin Dempsey and US Central Command chief General James Mattis.
Iraq was represented by military Chief of Staff Lieutenant-General Babaker Zebari and Defence Ministry Spokesman Major-General Mohammed al-Askari.
Al-Askari told Al Jazeera that the departure of the American forces will help hasten Iraq's progress.
"We have to depend on ourselves. Iraq is a big country, with its people and history, and cannot rely on another country to protect it. We are not afraid of this, our capabilities are growing rapidly, and we have the ability to protect Iraq," he said.
There are currently about 4,000 US troops still in Iraq, operating out of two bases in the city of Diwaniya and in Dhi Qar. That number is down from 170,000 at the height of the war.
A small contingent of troops remain in Baghdad, but will pull out following Thursday's ceremony.
While US President Barack Obama lauded the achievements of some of the last US troops to return home on Wednesday, residents of Baghdad were jubilant that the soldiers were leaving.
"I'm very happy because the occupier is leaving the nation ... the country will be ruled by its sons who will maintain it and keep its sovereignty," Salah al-Asadi, a tribal leader, told Al Jazeera.
"It's a joy for all Iraqis, not only for me. The US withdrawal from Iraq is something very big for us ... because the country’s security will be in the hands of our brothers at the police and the army, they are from us," said Abdelaziz Adel, a public servant.
Qassim Abdullah, another Iraqi citizen, said: "If the Americans have achieved anything, they have achieved it to their own benefit in the first place. They are the ones who get benefits from this issue. As for Iraqis, maybe they have the change they have been waiting for, but they paid high price for it as you can see the killings, devastation and sectarian violence. And up to now the situation is still unstable."
Al Jazeera looks back at the promises and predictions
that were made by Washington nine years ago
While US troops are pulling out, Washington is ramping up its diplomatic presence in Iraq, Al Jazeera's Jane Arraf reported from Baghdad.
"The US presence here will shift to a diplomatic, political and very much an economic one. To do that, they're keeping a huge embassy. It will be the biggest US embassy in the world ... between 15,000 and 16,000 people," she said.
There are concerns among regular Iraqis that the US will leave behind a country that is politically unstable, Al Jazeera's Omar al-Saleh reported from Baghdad's central Tahrir Square.
Obama paid tribute on Wednesday to about 3,000 soldiers gathered at the Fort Bragg military station in North Carolina on Wednesday, saying he was proud to welcome them home after what he called an "extraordinary achievement".
"Over the last few months, the final work of leaving Iraq has been done. Dozens of bases ... that house American troops have been closed down or turned over to the Iraqis," the president said, adding that troops would leave the country "with their heads held high".