“My health no longer allows this rate of stress”, the UN diplomat said on Twitter.
Talks between the UN-backed government based in the capital, Tripoli, and fighters loyal to renegade Gen Khalifa Haftar have floundered.
Last week Salamé brought representatives of the Government of National Accord (GNA) and the Haftar-led Libyan National Army (LNA), the two warring sides, to Geneva for peace talks, but the representatives suspended their involvement.
Salamé, in post for over two years, has been frustrated by the willingness of European powers including France to covertly back Haftar along with Russia.
Posting his resignation statement on his personal Twitter account, Salamé said he had spent two years trying to reunite the country and curb the influence of outsiders, but that he could no longer continue because of health reasons.
“My health no longer allows this rate of stress, and therefore I have asked the [UN] secretary general to relieve me of my duties,” he said.
UN chief António Guterres, in an interview with the BBC last month, termed the conflict a “proxy war”, adding that it was “unacceptable”.
An international summit was held in Berlin in January with hopes of cementing a fragile truce brokered by Turkey and Russia, who support rival camps in the war.
A final communique declared that the dozen countries participating in the meeting pledged to end the flow of weapons and armed personnel to Libya.