BAGHDAD - There was no "Mission Accomplished" banner. No victory parade down the center of this capital scarred and rearranged by nearly nine years of war. No crowds of cheering Iraqis grateful for liberation from Saddam Hussein.

Instead, the U.S. military officially declared an end to its mission in Iraq on Thursday with a businesslike closing ceremony behind blast walls in a fortified compound at Baghdad airport. The flag used by U.S. forces in Iraq was lowered and boxed up in a 45-minute ceremony. No senior Iraqi political figures attended.

With that, and brief words from top American officials who flew in under tight security still necessary because of the ongoing violence in Iraq, the U.S. drew the curtain on a war that left 4,500 Americans and more than 100,000 Iraqis dead.

The conflict also left another 32,000 Americans and far more Iraqis wounded, drained more than $800 billion from America's treasury and soured a majority of Americans on a war many initially supported as a just extension of the fight against terrorism after the 9/11 attacks.

As the last troops withdraw from Iraq, they leave behind a nation free of Saddam's tyranny but fractured by violence and fearful of the future. Bombings and gun battles are still common. And experts are concerned about the Iraqi security forces' ability to defend the nation against foreign threats.

"You will leave with great pride -- lasting pride," Defence Secretary Leon Panetta told the troops seated in front of a small domed building in the airport complex. "Secure in knowing that your sacrifice has helped the Iraqi people to begin a new chapter in history."

Many Iraqis, however, are uncertain of how that chapter will unfold. Their relief at the end of Saddam, who was hanged on the last day of 2006, was tempered by a long and vicious war that was launched to find non-existent weapons of mass destruction and nearly plunged the nation into full-scale sectarian civil war.

"With this withdrawal, the Americans are leaving behind a destroyed country," said Mariam Khazim, a Shiite whose father was killed when a mortar shell struck his home in Sadr City. "The Americans did not leave modern schools or big factories behind them. Instead, they left thousands of widows and orphans. The Americans did not leave a free people and country behind them, in fact they left a ruined country and a divided nation."

Some Iraqis celebrated the exit of what they called American occupiers, neither invited not welcome in a proud country.

"The American ceremony represents the failure of the U.S. occupation of Iraq due to the great resistance of the Iraqi people," said lawmaker Amir al-Kinani, a member of the political coalition loyal to anti-American cleric Muqtada al-Sadr.

Others said that while grateful for U.S. help ousting Saddam, the war went on too long. A majority of Americans would agree, according to opinion polls.

The low-key nature of the ceremony stood in sharp contrast to the high octane start of the war, which began before dawn on March 20, 2003, with an airstrike in southern Baghdad where Saddam was believed to be hiding. U.S. and allied ground forces then stormed across the featureless Kuwaiti desert, accompanied by reporters, photographers and television crews embedded with the troops.

The final few thousand U.S. troops will leave Iraq in orderly caravans and tightly scheduled flights.

The ceremony at Baghdad International Airport also featured remarks from Army Gen. Martin Dempsey, the chairman of the Joint Chiefs of Staff, and Gen. Lloyd Austin, the top U.S. commander in Iraq.

Austin led the massive logistical challenge of shuttering hundreds of bases and combat outposts, and methodically moving more than 50,000 U.S. troops and their equipment out of Iraq over the last year -- while still conducting training, security assistance and counterterrorism battles.

The war "tested our military's strength and our ability to adapt and evolve," he said, noting the development of the new counterinsurgency doctrine.

As of Thursday, there were two U.S. bases and about 4,000 U.S. troops in Iraq -- a dramatic drop from the roughly 500 military installations and as many as 170,000 troops during the surge ordered by President George W. Bush in 2007, when violence and raging sectarianism gripped the country. All U.S. troops are slated to be out of Iraq by the end of the year, but officials are likely to meet that goal a bit before then.

The total U.S. departure is a bit earlier than initially planned, and military leaders worry that it is a bit premature for the still maturing Iraqi security forces, who face continuing struggles to develop the logistics, air operations, surveillance and intelligence-sharing capabilities they will need in what has long been a difficult region.

Despite U.S. President Barack Obama's earlier contention that all American troops would be home for Christmas, at least 4,000 forces will remain in Kuwait for some months. The troops will be able to help finalize the move out of Iraq, but could also be used as a quick reaction force if needed.

Despite the war's toll and unpopularity, Panetta said earlier this week, it "has not been in vain."

During a stop in Afghanistan, Panetta described the Iraq mission as "making that country sovereign and independent and able to govern and secure itself."

That, he said, is "a tribute to everybody -- everybody who fought in that war, everybody who spilled blood in that war, everybody who was dedicated to making sure we could achieve that mission."

Iraqi citizens offered a more pessimistic assessment. "The Americans are leaving behind them a destroyed country," said Mariam Khazim of Sadr City. "The Americans did not leave modern schools or big factories behind them. Instead, they left thousands of widows and orphans."

The Iraq Body Count website says more than 100,000 Iraqis have been killed since the U.S. invasion. The vast majority were civilians.

Panetta echoed Obama's promise that the U.S. plans to keep a robust diplomatic presence in Iraq, foster a deep and lasting relationship with the nation and maintain a strong military force in the region.

U.S. officials were unable to reach an agreement with the Iraqis on legal issues and troop immunity that would have allowed a small training and counterterrorism force to remain. U.S. defence officials said they expect there will be no movement on that issue until sometime next year.

Obama met in Washington with Iraqi Prime Minister Nouri al-Maliki earlier this week, vowing to remain committed to Iraq as the two countries struggle to define their new relationship. Ending the war was an early goal of the Obama administration, and Thursday's ceremony will allow the president to fulfill a crucial campaign promise during a politically opportune time. The 2012 presidential race is roiling and Republicans are in a ferocious battle to determine who will face off against Obama in the election.