“If you’re willing to destroy your airport — that idea of national sovereignty, that we’re all in this together, then the issue of national identity is simply not as important as everyone thought it would be,” said Dirk Vandewalle, an associate professor at Dartmouth College and an expert on Libya who has visited regularly since the revolution.

Everyone seems stunned at the ferocity of the country’s arguments: divisions of ideology and identity that mask deeper struggles, over authority and wealth. Violence that was once sporadic now seems impossible to stop. Libya’s fighters, evenly matched with apparently limitless supplies of weapons and ammunition, appear unlikely to stand down on their own.

This time, the fighting in Tripoli seems at least partly fueled by the campaign of a general named Khalifa Hifter, who vowed in May to rid the country of Islamist militias. He and his self-proclaimed national army have focused their fight in Benghazi, where daily battles with the militias have settled into a deadly stalemate.

Mr. Hifter has won support from Libyans who fear the growing assertiveness of extremists, especially in eastern Libya. But his campaign has also stirred new divisions, and violence, across the country. Militias from the coastal city of Misurata that oppose Mr. Hifter have been clashing for weeks around the Tripoli airport with fighters from the mountain city of Zintan, who support him.

And the United States has sent mixed signals about Mr. Hifter’s efforts, warning about the violence while conceding that he was pursuing militiamen it considered terrorists.

After the 2011 revolution, Libya’s foreign allies had “a very light footprint” as the transition got underway, said Claudia Gazzini, a Libya researcher with the nonprofit International Crisis Group. The country seemed to be holding together better than many people had expected. “There was a consensus that this was a Libyan-led transition” — as well as a general feeling that a turbulent transition would be smoothed out by elections.

“There was some naïveté in that approach,” Ms. Gazzini said.

Colonel Qaddafi’s dictatorship had left a country bereft of institutions, or consensus political figures, that might ease the transition. The NATO intervention left its own troubling legacy, stirring fights over resources provided by foreign patrons. Libyans seemed focused on creating the institutions that “the West was interested in seeing them create,” said Professor Vandewalle, including elections and a political system. “It was hollow,” he said.