The UN special envoy to Libya has warned that chaos in the north African country could destabilise the whole region if rival politicians fail to nail down a political agreement within the next few days.
Bernardino Leon told rival politicians meeting in Morocco for peace talks on Friday that the international community was growing impatient and feared the unrest could spillover into neighbouring countries.
"Terrorism in Libya is becoming a problem for Libyans and a problem for the region," he said.
Leon said meetings with Libyan delegations over the next three days in Rabat would focus on security arrangements, the creation of a national unity government and confidence-building measures.
RELATED: What is not being discussed about Libya
"By Sunday, we would like to have these three documents ready and if possible, published, as already agreed [as] part of what will be a final package," he said.
In an effort to address the crisis, Libyan delegations have been meeting with Leon in what has been described as one of the last chances to stop the country from plunging into a full-scale civil war.
The country has grown increasingly polarised since longtime leader Muammar Gaddafi was overthrown and killed more than three years ago, as clashes rage between armed groups and rival parliaments.
The UN-recognised government was driven out of Tripoli last year and has been confined to the small eastern city of Tobruk, while the General National Congress (GNC), a legally-installed rival parliament, operates out of the capital Tripoli.
RELATED: The rise and rise of Libya's rogue general
Talks have dragged on for months in different venues with little results as fighting across Libya continues to escalate.
Any agreement by the political factions must also be accepted by various militias and warring military groups, including former General Khalifa Haftar, who leads the country's forces in the east, and who has previously condemned the talks as discussions with "terrorists."
Since the end of Gaddafi's one-man rule, the country has failed to build up a national army and efficient state institutions and is now effectively dominated by former rebel brigades who disagree over how to govern Libya and share its oil wealth.
The country's three main cities, Tripoli, Benghazi and Misrata, are largely controlled by militias, with more than 400,000 people displaced by the fighting.