Libya’s interim leaders say they hope an elected government will have the legitimacy to rein in those militias, and the country is rushing to hold votes. The two largest cities, Benghazi and Tripoli, plan to hold local elections by May, while the Transitional National Council has promised elections in June for an assembly that will govern as it writes a new constitution.

Without a national army or police force, though, many civilians worry that the militias could bully voters, suppress votes or otherwise dominate the process, leaving Libya mired in internecine violence, torn by regional tensions or — as a recent poll suggests many Libyans may now expect — vulnerable to the rise of a new strongman.

Even civilian politicians alarmed by the interplay of guns and politics say they may be powerless to resist it. “We are very clearly saying we don’t want to be part of that,” said Ali Tarhuni, a former interim oil minister and deputy prime minister now starting one of the new parties. “But down the road, what can we do?”

Mr. Tarhuni and others say they fear that Libya could repeat the experience of Lebanon, where armed militias formed during its civil war became a permanent part of the political landscape. Already some brigades around the country, including the one at the airport, led by Mokhtar al-Akhdar, have developed independent sources of revenue, primarily from providing security services. “Protection,” Mr. Tarhuni said.

Others say Libya may yet confound the expectations of chaos on the various election days. The relatively homogeneous city of Misurata recently held peaceful elections. Here in the more divided capital and across the country, Libyan officials admit that they are banking on intangibles, like Libya’s tribal traditions, the unifying spirit of the revolution and the patriotism of its young militiamen, to maintain a degree of order. Nevertheless, Mustafa Abu Shagour, deputy prime minister of the interim government, said he expected to see guns in the streets.