The last U.S. troops crossed the border out of Iraq shortly after 7 a.m. Sunday, officially ending a war that gave rise to a fledgling and still unstable democracy in Iraq but also cost almost $1 trillion and the lives of some 4,500 American service members.

The troops crossed a berm at the Kuwaiti border that was lit with floodlights and ringed with barbed wire, and were met by Gen. Lloyd J. Austin III, who until Friday was the top U.S. commander in Iraq. The convoy’s arrival in Kuwait, after a week of ceremonies in Baghdad marking the end of the war, was kept shrouded in secrecy to protect the almost 500 troops and more than 110 vehicles that were part of the last convoy.

The quiet exit of the last U.S. forces highlighted the danger and uncertainty that remains in Iraq, even as violence throughout the country has fallen to its lowest level since the 2003 invasion.

The last of the troops left Contingency Operating Base Adder about 2:30 a.m. Kuwait time for the 218-mile trek through the empty, dark desert to the border. In contrast to the U.S. invasion in 2003, the final American convoy, made up of soldiers from the 3rd Brigade, 1st Cavalry Division, drew little notice from Iraqis. The road from the U.S. base to the border was almost entirely deserted, which was the way the U.S. military wanted it.

As the trucks approached the border crossing with Kuwait, excitement built among the four soldiers in Sgt. 1st Class Rodolfo Ruiz’s armored vehicle. Many of the men had not slept for 24 hours, as they prepared for the last convoy out and for the order to go. Ruiz and the other three soldiers were part of the second-to-last contingent to cross into Kuwait, and they preceded the very last U.S. military trucks by about 45 minutes. “I just can’t wait to call my wife and kids and let them know I am safe,” Ruiz said as the border came into sight. “I am really feeling it now.”

About 15 minutes later, Ruiz let his men know that their mission was over. “Hey guys, you made it.”

The soldiers wondered aloud what the Iraqis would think as they moved across the base and noticed that the remaining U.S. troops were gone. The day before the Americans left, they officially turned over ownership of the base to the Iraqi air force, which renamed it Imam Ali Air Base. Because the Iraqi air force is so small, the only plane there was a small passenger jet that was missing its landing gear and had not been flown in years. Most of the Iraqi air force’s small contingent of planes is based in and around Baghdad.

“The Iraqis are going to wake up in the morning and no one will be there,” mused one of the soldiers as they approached the border.

Early Saturday, the brigade’s remaining interpreters, all of them U.S. citizens, made their routine calls to the tribal sheiks and government leaders so that they would assume it was just a normal day. About 11 a.m., leaders of the brigade held a ceremony at the Adder base to mark the end of its deployment. The remainder of the brigade’s 4,000 troops had already passed across the border and were headed home.

For the final ceremony, about 25 soldiers sat on folding chairs in front of two armored vehicles to watch as the brigade’s flags and battle streamers from previous conflicts were rolled up and packed in a camouflage liner.

“Most people don’t understand what they have been a part of here,” said Command Sgt. Maj. Ron Kelley, the senior enlisted soldier in the brigade. “We have done a great thing as a nation. We freed a people and gave their country back to them.”

After Kelley spoke, the brigade’s commander struck a similar chord.

“We’re proud of you. Be proud of yourselves,” Col. Doug Crissman, the brigade commander, told them. The entire ceremony lasted about five minutes, and then the soldiers headed out to load the last of their possessions and line up by their vehicles.

By dusk Saturday, the vehicles had been formed into five columns near the base’s southern exit. A half-dozen television news correspondents moved among the troops gathering footage.

Throughout the week, many of the brigade’s troops had insisted that the deployment’s end felt no different than previous tours they had made to Iraq and Afghanistan over the course of a long decade of war. But as they looked out on the large convoy, several soldiers said they had begun to grasp the importance of the mission.

“At first, I didn’t see the big picture, as far as us leaving a country where we fought,” said Spec. Tyler Meier, 20, of Ottumwa, Iowa. “It’s a big deal, because it has never really been done before. We still have troops in Europe. We still have soldiers in Korea. As we drove by, I realized, ‘Damn, that is a lot of vehicles.’ Now, it is pretty exciting. We are going down in the history books, you might say.”