The UN's envoy to war-plagued Libya, Ghassan Salame, announced his resignation on Monday citing health reasons, nearly three years after taking up the post.
"I tried to unite Libyans and restrain foreign interference... but for health reasons I can no longer continue with this level of stress and therefore I have asked the (UN) secretary-general to relieve me of my duties," Salame tweeted.
He added that he wished Libyans "peace and stability".
A source close to the UN envoy confirmed to AFP that the veteran Lebanese diplomat was stepping down.
His job had involved efforts to bring an end to years of turmoil since the 2011 overthrow of longtime dictator Moamer Kadhafi, which left Libya divided between rival governments and beset by violence.
Salame's resignation comes after months of work to bring about a ceasefire since eastern-based military commander Khalifa Haftar launched an offensive in April to seize the capital Tripoli, seat of the UN-recognised Government of National Accord (GNA).
The unity government is supported by Turkey, while Haftar is backed by UN Security Council permanent member Russia -- two countries that also back opposing sides in Syria's conflict.
Salame, a former Lebanese culture minister, was appointed UN envoy in June 2017 and has struggled to bring the two sides together for talks to end Libya's conflict.
Earlier this year the rivals agreed to a ceasefire brokered by Turkey and Russia that went into effect on January 12, but there have been repeated violations.
Political talks were due to start in Geneva last week but both sides refused to attend.
The talks were to run in tandem with military and economic negotiations as part of a UN-sponsored dialogue aimed at resolving the conflict.
Need 'much more' support
On Friday, Salame lashed out at "cynics" he said were undermining the talks and said he needed "much more" international support, even as Tripoli's only working airport was hit yet again by rocket fire.
Salame warned of "almost a breakdown of that truce", adding that "many areas" of Tripoli were also hit.
Salame said he wanted a UN-facilitated process for political, military and economic talks between the two sides to continue even though they had both declined to attend the Geneva talks.
"We are pursuing our line despite the procrastination of these cynics," he said.
The international community had voiced its support for the UN-sponsored talks at a summit in Berlin in January.
"Did I get the kind of support needed since then?" Salame asked on Friday. "My answer is no. I need much more support."
Born in 1951, Salame spent most of his career as a professor of international relations at France's prestigious Sciences Po university in Paris.
He served as culture minister in Lebanon from 2000 to 2003 and later worked as an advisor to former UN secretary-general Kofi Annan and to the UN mission in Iraq.
He had taken up the post of UN Libya envoy from Martin Kobler of Germany, who had served from November 2015 until June 2017.