PORT-AU-PRINCE, Haiti  Along the capital’s main commercial strip Saturday afternoon, dozens of armed men  some wielding machetes, others with sharpened pieces of wood  dodged from storefront to storefront, battering down doors and hauling away whatever they could carry: shoes, luggage, rolls of carpet.

Jean-Mario Mondésur, 41, a bookkeeper, wandered by the street, Boulevard Jean-Jacques Dessalines, to join the crowd of onlookers. Minutes later, he had seen enough. “There are bad men here, we must run!” he shouted.

While most of this city of 3 million people focused on clearing the streets of debris and pulling bodies out of the rubble left by Tuesday’s earthquake, there were pockets of violence and anarchy, reports of looting and ransacking, and at least one lynching of an accused looter as police officers stood aside.

Image A body burning in a Pétionville street. Bystanders said he was taken from the police and killed. Credit... Ruth Fremson/The New York Times

Both impulses  the riotous theft and the vigilante response  were borne of desperation, the lack of food and water as well as the absence of law and order. Given the conditions, it was all the more remarkable that a spirit of cooperation and fortitude prevailed nearly everywhere else, as people joined together to carry corpses, erect shelters and share what food they could find.