US Vice President Joe Biden, in Iraq as the last American soldiers prepare to depart, thanked troops from both sides for their shared sacrifices, saying they helped to end the war.
But even as Biden spoke of the conflict drawing to a close, 18 people were killed in attacks in Diyala province, north of Baghdad, 10 of them in a market bombing in the town of Khales.
"We're gathered here to thank the armed forces of Iraq and America, and to honour your sacrifice, to honour your success, as well as your commitment," Biden said at a ceremony at Al-Faw palace in the sprawling Victory Base Complex near the capital.
"Because of you ... and the work those of you in uniform have done, we are now able to end this war," Biden said at the ceremony attended by Iraqi Prime Minister Nuri al-Maliki, President Jalal Talabani and US ambassador James Jeffrey.
He praised soldiers at the gathering for helping lay the foundation "for a long-term strategic partnership between our nations" and said Iraq could now serve as a source of stability in the region "for years to come."
"I think it's fair to say, almost no one thought that was possible a few years ago," he said.
Biden also paid tribute to the casualties of the conflict, including 4,486 US troops killed and more than 30,000 wounded.
"For you Iraqis, the cost of war was still greater. Hundreds of thousands of your fellow citizens lost their lives," he said.
US President Barack Obama announced on October 21 that US troops would leave Iraq by the end of 2011, bringing to a close an almost nine-year war that, besides the loss of human lives, cost Washington hundreds of billions of dollars.
Less than 14,000 US soldiers remain in Iraq.
The US-Iraq relationship, "long defined by the imperative of security alone, is now giving way to a new, more normal partnership between sovereign nations seeking to build a future together," Biden said.
In his own remarks at the ceremony, Maliki said that "we should proudly remember the confrontation that our armed forces conducted side by side with all coalition forces, especially American forces, in a world war against terrorism."
Signup to our newsletter and follow us on Facebook and Twitter!
He offered congratulations to the Iraqi people on the occasion of the US withdrawal, and thanks to the Obama administration for its commitment to implement it.
"I congratulate the Iraqi people, and the members of the armed forces, on this day, which we view as a new dawn," Maliki said, adding later in his remarks that "I congratulate all the Iraqi people on behalf of the government on the occasion of regaining full sovereignty."
"Completing the withdrawal of foreign forces from Iraq will remove the cover for the terrorist Al-Qaeda organisation ... and the rest of the armed groups in conducting terrorist operations," Maliki said.
After the ceremony, which was also attended by General Lloyd Austin, the top US commander in Iraq, various diplomats and a number of US and Iraqi soldiers, Biden flew to Arbil, the capital of the autonomous Kurdistan region.
There, he met with Kurdistan's president, Massud Barzani, according to reporters travelling with him.
After Iraq, Biden was to travel to Turkey and to Greece, seeking to ease two foreign headaches haunting the United States -- Middle East security and Europe's debt crisis.
The Iraq war is drawing to a close for the United States, but Iraqis still face near-daily attacks.
An Iraqi army colonel said Thursday's deadly blast at the Khales vegetable market, the latest bloody attack in Iraq in recent days, was caused by a car bomb.
"We counted 10 bodies and at least 20 wounded in the explosion," he said, speaking on condition of anonymity.
The casualty toll was confirmed by a medic at the main hospital in the Diyala provincial capital, Baquba.
In a separate attack, gunmen using silencers raided three homes in the Diyala village of Jil al-Said, south of Baquba, killing eight people, among them two commanders of an anti-Qaeda militia and members of their families, the army colonel said.
Violence has declined in Iraq since its peak in 2006 and 2007, but a total of 187 people were still killed in November, according to official figures released on Thursday.