Where 500 U.S. bases once housed as many as 170,000 troops, the American military footprint had shrunk to two bases and 4,000 soldiers — all with orders to pack up and move out by the end of month.
"I have instructed and encouraged my soldiers to take it all in, take pictures, write stuff down, keep a journal," he said. "Because as we look back, I think we're going to realize that this was a truly historic time."
U.S. officials declared an end to the mission in Iraq on Thursday, lowering the flag used by American forces in a ceremony at Baghdad International Airport attended by Defense Secretary Leon E. Panetta and Gen. Martin Dempsey, chairman of the Joint Chiefs of Staff.
The declaration came more than eight years after the U.S.-led invasion that toppled the regime of Saddam Hussein, triggering years of violent conflict but also clearing the way for democratic elections. While the regime crumbled within weeks of the March 2003 invasion, U.S. forces soon found themselves targeted by insurgents, and the country teetered from sectarian violence toward civil war.
Nearly 4,500 Americans were killed and 32,000 wounded. The Iraqi death toll is estimated at more than 100,000.
"To be sure, the cost was high — in blood and treasure for the United States and for the Iraqi people," Panetta told an audience that included about 200 troops and a few Iraqi officials. "But those lives were not lost in vain — they gave birth to an independent, free and sovereign Iraq."
President Barack Obama, who campaigned in 2008 on pledges to end the war in Iraq and focus on Afghanistan, thanked the troops Thursday during an appearance at Fort Bragg, N.C.
"Because of you, because you sacrificed so much for a people that you had never met, Iraqis have a chance to forge their own destiny," Obama said.
In Fallujah, the scene of brutal fighting between U.S. troops and Iraqi insurgents in 2004, thousands of Iraqis celebrated the withdrawal, according to news reports. Some waved photographs of dead relatives and burned American flags.
Other Iraqis expressed concern for their future.
"The Americans are leaving behind a destroyed country," Mariam Khazim told the Associated Press in Baghdad.
"The Americans did not leave modern schools or big factories behind them," said Khazim, whose father was killed when a mortar shell struck his home in Sadr City. "Instead, they left thousands of widows and orphans. … They left a ruined country and a divided nation."
The U.S. declaration Thursday came after Washington and Baghdad were unable to reach an agreement to keep American forces in the country beyond Dec. 31. With sporadic violence continuing, security after the U.S. departure is uncertain.
"Let me be clear," 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. Challenges remain, but the United States will be there to stand with the Iraqi people as they navigate those challenges to build a stronger and more prosperous nation."
Maryland National Guard units still in Iraq include a network support company of the 1204th Aviation Support Battalion and a company of the 1st Battalion 111th Aviation Regiment, Lt. Col. Charles S. Kohler, a spokesman said Thursday. The Maryland National Guard deployed 3,393 soldiers to Iraq during the war.
The 29th Combat Aviation Brigade, which arrived in Iraq two months ago, is the last combat aviation brigade in the country, Carey said. Its helicopters are to be the last to be flown in Iraq by U.S. forces.
Based at Camp Taji, about 20 miles north of Baghdad, the brigade has been flying several missions a day, ranging from transporting official visitors to combat support operations. The unit helped provide aerial security Thursday for the 45-minute ceremony at Baghdad International Airport.