TRIPOLI, Libya — As the militiamen saw it, they had the best of intentions. They assaulted another militia at a seaside base here this week to rescue a woman who had been abducted. When the guns fell silent, briefly, the scene that unfolded felt as chaotic as Libya’s revolution these days — a government whose authority extends no further than its offices, militias whose swagger comes from guns far too plentiful and residents whose patience fades with every volley of gunfire that cracks at night.

The woman was soon freed. The base was theirs. And the plunder began.

“Nothing gets taken out!” shouted one of the militiamen, trying to enforce order.

It did anyway: a box of grenades, rusted heavy machine guns, ammunition belts, grenade launchers, crates of bottled water and an aquarium propped improbably on a moped. Men from a half-dozen militias ferried out the goods, occasionally firing into the air. They fought over looted cars, then shot them up when they did not get their way.

“This is destruction!” complained Nouri Ftais, a 51-year-old commander, who offered a rare, unheeded voice of reason. “We’re destroying Libya with our bare hands.”