But Haftar had erred. By attacking the Islamists, he had lumped moderates together with jihadists and, as time wore on, the balance of power shifted to the radicals, bolstered by an influx of Tunisians, Egyptians, and other foreigners. In early 2015, the Islamic State arrived and exploited the chaos. Islamists who might’ve reconciled with the Libyan state were killed off or exiled, or they cast their fates with the so-called caliphate.

By late 2015, when I visited Benghazi, Operation Dignity was locked in a stalemate. I visited field hospitals where I saw Haftar’s men torn apart by mines and snipers. Vast swathes of the city were no-go zones.

* * *

When I returned this May, I found a battlefield completely changed. Haftar’s forces had all but declared victory.

To be sure, fighting still rages, and parts of the city lie in ruin, including the iconic old city and its courthouse, site of the first protests against Qaddafi in 2011. The expansive, recently liberated Fish Market district, where families once gathered on Ramadan nights, is now a shamble of concrete. Shelling has scarred the Italianate porticos of Tree Square, once beloved for its cedar, and destroyed the covered bazaar of Suq al-Jarid, once filled with tailors, jewelers, and leather-smiths. Soldiers still fall from sniper fire and, especially, booby-traps—diabolical devices triggered by thin planks of wood covered with sand, trash, or grass. Civilians still perish from salvos of rockets or mortars, often at night. One morning I witnessed the aftermath of such an attack: a gaping crater, an incinerated car, and a young man grieving for his brother.

Yet in many parts of the city I felt the pulse of normalcy. In the old district of Birka, the green-checkered flags of the Nasr football club, a local favorite, crisscross the bustling streets. Traffic police who once cowered at home for fear of assassination are stationed once again at intersections, wearing their summer white uniforms. Factories and farms are creaking back to life, while younger entrepreneurs try their hands at tech start-ups, participating in competitions for innovative app designs. The university is reopening.

Leisure has returned as well. At the Luna Mall, children play on a toy train next to ice cream parlors, candy stores, and clothing outlets. There are musical clubs, theater troupes, art galleries, and rugby tournaments. Sitting on the lawn of a new hotel, newlyweds smoke apple-flavored tobacco while a projector plays Egyptian soap operas on a wall.

This is one face of Benghazi—the one of progress and order. There is, of course, another side.

* * *

Benghazi’s war is not simply an army operation against terrorists, but a deeply intimate social conflict, between neighbors and cousins, overlaid with tribal- and class-based tensions, between eastern tribes and families from the west, among eastern tribes, and between urban elites and rural poor. Reports of torture, disappearances, and the destruction of property emerge with numbing frequency. So, too, has evidence of summary executions, on both sides.