Updated

The fight against terrorism has produced results in Libya but those gains are not irreversible, the U.N.'s special envoy to the North African nation said Tuesday.

Martin Kobler told the Security Council that advances against terrorists have been made in both the western and eastern parts of the country and that the Islamic State group's presence in the city of Sirte has been reduced from the entire city to just a few buildings.

"Although they continue to be a threat, the days of the Islamic State controlling territory in Libya are over. While in Benghazi, the Libyan National Army continues to make progress, taking area after area," Kobler said.

But he cautioned that these gains may be fleeting unless Libya can develop coherent security apparatus and shore up its ailing economy.

He said the "fragmented security situation allows criminal and terrorist networks to flourish," and that despite an arms embargo the country continues to be awash in weapons. He estimated that there are 26,000 guns in a country of six million people.

Kobler also pointed out that over the past month the country has seen some of the most violent clashes in Tripoli since 2014, with armed groups in the city competing for territory. He said the clashes were triggered by the murder of religious scholar Nader al Omrani.

He also warned of a steadily weakening economic situation despite significantly increased oil production, which has tripled since August to nearly 600,000 barrels per day.

Libya's budget deficit currently stands at around 70 percent of GDP and its financial reserves have shrunk to $45 billion from $108 billion in 2013.

"The lack of rule of law, corruption and high yields on the black market result in billions of dollars disappearing into shadowy accounts," Kobler said. "The country will face an economic meltdown unless something changes."