Born in 1996, Ahmed grew up comfortably in Janzur, a seaside settlement on Tripoli’s western edge. Then came the oil boom, and along with it, a rush of migrants from the hinterland. Janzur soon expanded into a suburb of the capital, complete with gated “tourist villages” and an American school favored by diplomats.

In 2013, Ahmed entered the University of Tripoli to study engineering. He was not religiously observant back then. He smoked cigarettes and drank bokha, a potent home-brewed alcohol. His first semester in school was a time of dislocation and questioning, wrought by turmoil in Libya and across the region. The uprising in Syria gripped him; its parallels to the struggle against Qaddafi were obvious. “We’d suffered, and we knew the Syrians were suffering too,” he told me.

Ahmed watched the Syrian war from afar, on the Internet and on Saudi satellite stations. He recalled popular Saudi clerics beseeching their audiences to support the revolution. It was a religious obligation, they said, incumbent upon all believers. But these arguments alone did not persuade him—it took a horrifying atrocity to do that. In the pre-dawn hours of August 21, 2013, a Syrian Republican Guard artillery crew in Damascus launched volleys of sarin rockets into the city’s eastern neighborhood of Ghouta. U.S. government estimates put the civilian death toll at over 1,400. Ahmed was outraged. “After Ghouta, I really decided,” he told me.

Getting to Syria wasn’t hard. A Syrian man in Tripoli gave Ahmed the information for a contact in Turkey. “Call this guy,” he said, “he will tell you where to go.” Once he made it to Aleppo, Ahmed joined a small militia of Libyan fighters who had joined Syrian Salafist groups; some, like the Nusra Front, were linked to al-Qaeda. They encamped on farmlands dotted with grain silos and transmission towers, where Ahmed trained on a 14.5-mm gun.

In October 2013, the Syrian army launched an armored blitz aimed at choking off Aleppo and cutting the rebels’ supply lines to Turkey. The Libyans fought in the battle of Brigade 80, an army base near the international airport, then retreated north to Tiyara, a hamlet of beehive homes and olive groves. Here, Ahmed manned the defenses of an old factory that the rebels had taken, just east of a hill where Hezbollah snipers and Syrian soldiers had the commanding heights. One day, a Libyan fighter next to him—a childhood friend from Janzur— fell dead after being shot in the head. And so in December of 2013, a shaken Ahmed decided to leave the front. But leaving Syria would prove much harder than entering.

In January 2014, the rebels fell into factional fighting. Ahmed barely escaped with his life, crossing west until he reached the Turkish border. By February he was back in Tripoli, safe and exhausted. But he wasn’t finished with war. In the summer of 2014, the capital was consumed by the civil war between the so-called “Dawn” faction, comprised of militias from western towns led by Misrata and some Tripoli neighborhoods and Islamists, and the “Dignity” faction, led by General Khalifa Hifter in the east, which included forces from the western mountain town of Zintan. Ahmed joined a militia from Janzur, fighting on the side of Dawn.