The UN envoy for Libya has resigned citing health reasons after nearly three years in the post.

Appointed in July 2017, Ghassan Salame had recently been mediating three-tiered talks between Libya's warring sides on economic, political and military tracks.

More:

In a tweet on Monday, Salame cited the "level of stress" as a reason behind his intention to step down as the UN's envoy for the war-wracked country.

"For two years, I tried to re-unite Libyans and restrain foreign interference ... but for health reasons I can no longer continue with this level of stress," wrote Salame.

"Therefore I asked the [UN] secretary-general to relieve me of my duties."

Libya, a major oil producer, was plunged into chaos following a NATO-backed uprising in 2011 that toppled Muammar Gaddafi, who led the country for more than 40 years.

The inability of successive governments to demobilise and reintegrate fighters that helped remove Gaddafi compromised reconstruction efforts in the war-torn country.

In April 2019, Khalifa Haftar, a renegade military commander based out of eastern Libya, launched an assault on the capital, Tripoli, where the country's internationally recognised government sits.

'Lack of support'

A UN spokesperson, Stephane Dujarric, confirmed that Secretary-General Antonio Guterres received Salame's resignation.

"The secretary-general has always had full confidence in Salame's work and the great efforts he has made to bring peace to Libya," Dujarric said. "[Guterres] will be discussing with Salame the way to ensure a smooth transition so as not to lose any momentum on the gains that have been made."

Salame, a former culture minister in his native Lebanon and an international relations professor, had time and again regretted a lack of cooperation on the part of the international community, especially countries that support one or the other of Libya's warring sides.

"Did I get the kind of support needed...?" Salame mused on Friday. "My answer is no. I need much more support."

An international summit was organised in Berlin in January with hopes of cementing a fragile truce brokered by Turkey and Russia, who support rival camps in the war.

That conference came after Turkey began deploying troops to Libya - including rebel fighters from Syria - and amid reports Russian mercenaries were assisting Haftar's forces outside Tripoli.

A final communique declared that the dozen countries participating in the meeting pledged to end the flow of weapons and armed personnel to Libya

But that promise was broken almost as soon as the document was signed, with media reports the next day indicating the United Arab Emirates, a key Haftar supporter, was flying in military equipment to Haftar's forces in eastern Libya.

"If you look at things objectively, he hasn't been able to achieve much in terms of improving their [Libyans] situation but I don't think that would be a useful approach, to blame him exclusively for Libya's problems," said Emadeddin Badi, a non-resident scholar at the Middle East Institute.

"This is a man who, if you compare him with previous envoys, understood Libya more and made more efforts. Unfortunately, he came at a critical juncture where a lot of foreign actors, even European states, were deploying policies that were counterproductive in terms of what he was aiming to do."