PORT-AU-PRINCE, Haiti — U.S. troops are withdrawing from the shattered capital, leaving many Haitians anxious that the most visible portion of international aid is ending even as the city is still mired in misery and vulnerable to unrest.

As troops packed their duffels and began to fly home this weekend, Haitians and some aid workers wondered whether U.N. peacekeepers and local police are up to the task of maintaining order. More than a half-million people still live in vast encampments that have grown more unpleasant in recent days with the early onset of rainy season.

Some also fear the departure of the American troops is a sign of dwindling international interest in the plight of the Haitian people following the catastrophic Jan. 12 earthquake.

“I would like for them to stay in Haiti until they rebuild the country and everybody can go back to their house,” said Marjorie Louis, a 27-year-old mother of two, as she warmed a bowl of beans for her family over a charcoal fire on the fake grass of the national stadium.

U.S. officials say the long-anticipated drawdown of troops is not a sign of waning commitment to Haiti, only a change in the nature of the operation. Security will now be the responsibility of the 10,000-strong U.N. peacekeeping force and the Haitian police.

A smaller number of U.S. forces — the exact number has not yet been determined — will be needed as the U.N. and Haitian government reassert control, said Gen. Douglas Fraser, head of U.S. Southern Command, which runs the Haiti operation. “Our mission is largely accomplished,” he said.

U.S. forces arrived in the aftermath of the quake to treat the wounded, provide emergency water and rations and help prevent a feared outbreak of violence. They also helped to reopen the airport and seaport.

There has been no widespread violence but security is a real issue. A U.N. food convoy traveling from Gonaives to Dessalines on Friday was stopped and overrun by people, who looted two trucks before peacekeepers regained control, U.N. officials said.

They managed to escort the other two back to Gonaives. There were no reports of injuries.

The military operation was criticized by some Haitian senators and foreign leaders as heavy-handed and inappropriate in a country that had been occupied by American forces for nearly two decades in the early 20th century. But ordinary Haitians largely welcomed the troops, many out of disenchantment with their own government.

“They should stay because they have been doing a good job,” 35-year-old Lesly Pierre said at an encampment in Petionville. “If it was up to our government, we wouldn’t have gotten any help at all.”