August 18, 2016 6:30 AM EDT

“They are like ghosts.” That’s how a Libyan sniper described ISIS fighters in Sirt to Lorenzo Meloni. The Italian photographer recently returned from the front in the group’s last stronghold in Libya, as pro-government forces battle for control.

Meloni arrived in Misrata in mid-June and was on the outskirts of Sirt the next day. Many buildings there had been destroyed by mortars or airstrikes over the years, perhaps never restored after the fighting in 2011. The photographer, who is represented by Magnum Photos, has spent significant time in Libya in recent years. He documented the revolution that ousted the ex-dictator Muammar Gaddafi, the civil war that followed and the migrant-smuggling crisis. He has no parallels for what he experienced in Sirt. Not with an enemy like ISIS.

“Anything can happen,” he tells TIME. “That’s the most terrifying.”

Meloni stayed with several militias aligned with the U.N.-backed unity government. He left shortly before the U.S. launched airstrikes, announced in early August, to help the pro-government forces reclaim more territory. The fighters didn’t engage every single day, but there were several major offensives when the central command coordinated larger efforts. A fair amount of time was spent waiting for something to happen, the photographer admits, but when it came time for battle, it sometimes meant just wading into the direction of ISIS. “Everything can change very quickly,” he says. “Maybe there’s a sniper on the other side who spots you.”

Meloni was surprised by how littered Sirt was with mines and booby traps. “They are everywhere, everywhere,” he says. In one area, they found a mass grave.

He put a lot of trust in the Libyans who he embedded with and grappled with the fact that even if he did everything he could to protect himself, others may not be as cautious. He tried to figure out who was best to follow and who was on “a suicide mission,” and adds that luck is important. On one of his final days in Sirt, Meloni was following a group of Libyan fighters who told him they planned to run through a field toward a target—while under sniper fire. If he ran, he might encounter a mine. If he didn’t, a sniper could take him out. “I would have to be too aware of my life. It’s not just about ‘go, go, go,’” he says. “You have to realize the limits of your job.”

Meloni says that oft-hazy balancing act of pictures you want to make versus pictures you need to make was clear in Sirt. “I tried to calculate the risk based on what I needed,” he says. “I don’t want to get killed for a picture.”

Lorenzo Meloni is a photographer represented by Magnum Photos.

Alice Gabriner, who edited this photo essay, is TIME’s International Photo Editor.

Andrew Katz is TIME’s International Multimedia Editor. Follow him on Twitter @katz.

More Must-Read Stories From TIME

Contact us at letters@time.com.

EDIT POST