Libya's warring factions have reacted positively to a draft peace agreement, the UN envoy said Tuesday, as they head for talks in Berlin with world powers anxious for an end to the conflict.
Libya descended into chaos after a 2011 NATO-backed uprising toppled and killed veteran dictator Moamer Kadhafi, with heavily armed former rebels carving out fiefdoms across the country.
The quest for a deal seeks to prevent the oil-rich and strategic North African nation from crumbling into a failed state.
Bernardino Leon, chief of the United Nations Support Mission in Libya, presented the draft to delegations from the country's rival sides at talks in Morocco late Monday.
With strong support from world leaders, he is pushing for a final accord before the start of the Muslim holy month of Ramadan on June 17.
"We have distributed, as you will have seen, a new proposed agreement. All I can tell you for now is that the reaction is positive," Leon told journalists.
"We are looking at the possibility of a triple consensus -- within Libyan society, among the participants in the dialogue and also the international community."
He said there was "sense of optimism" emerging from the talks, but warned that no agreement would work without the backing of armed groups in Libya.
"The security track is important. We need strong support from the armed formations... We will not succeed if we don't have their support," Leon said.
The Spanish diplomat had spent Tuesday morning shuttling between the negotiating teams to gauge their response.
"Then we will all head to Berlin to meet European leaders and member countries of the UN Security Council," UN mission spokesman Samir Ghattas told AFP, without saying whom they would meet.
German Foreign Minister Frank-Walter Steinmeier has invited them to Berlin to continue talks Wednesday with Leon as well as meet diplomats from the UN Security Council's permanent five members, plus Italy, Spain and the European Union, his ministry said.
G7 leaders have thrown their support behind Leon's efforts to persuade the factions to forge a united administration to replace the rival governments in the capital Tripoli and Tobruk.
In a closing statement after a summit in Germany, the G7 called on Libyan leaders to take "bold political decisions" to end four years of devastating conflict.
Signup to our newsletter and follow us on Facebook and Twitter!
It said it would "provide significant support" to help a new government rebuild infrastructure, including restoring public services and strengthening the economy.
- Draft plan -
Jihadist groups have exploited the lawlessness, which has also prompted a huge influx of migrants trying to make the dangerous crossing to Europe, with shipwrecks leaving hundreds dead and the European Union straining to respond.
The draft agreement put forward Monday is the fourth, with three previous rounds of negotiations failing to deliver a deal.
The 69-article plan provides for the formation of a transitional government of national unity for a period of one year, renewable for one more year.
It stipulates that the parliament elected last June, most of whose members back the internationally recognised government in Tobruk, should be the legislative authority for the interim period.
But it also provides for the formation of a high council of state, drawn mostly from members of the rival parliament in Tripoli, which "shall express binding opinion with a qualified majority on draft laws".
The two sides would commit to the integration of their opposing militias into a reformed military under direct government control with former rebel fighters offered the opportunity to join up or be reintegrated into civilian life.
The agreement sets out interim security arrangements for the withdrawal of armed formations from towns and cities and a timetable for disarming.
"The government of national accord, through its different relevant institutions, including the army and police, shall take the necessary steps to combat terrorist threats in Libya," the draft says.
Some members of the internationally recognised parliament based in the eastern city of Tobruk, speaking on condition of anonymity, said there is still disagreement on at least two points in the draft. They did not elaborate.
Both administrations have been fighting loyalists of the Islamic State group, which has taken several coastal towns to the alarm of an international community fearful of a jihadist foothold on Europe's doorstep.
IS, which controls swathes of Syria and Iraq, has won the loyalty of several Islamist groups in Libya and claimed responsibility for a series of attacks and atrocities, including the killings of dozens of Egyptian and Ethiopian Christians.