Peace talks between Libya's warring factions kicked off in Geneva Wednesday in what their United Nations mediator warned could be a last chance to prevent all-out chaos in the oil-rich country.
The North African nation has been gripped by deepening conflict since the overthrow of dictator Moamar Kadhafi in a NATO-backed uprising in 2011, with rival governments and powerful militias battling for control of key cities and the nation's oil wealth.
It has taken the UN months to get the opposing sides back to the negotiating table after a single round of talks in September.
"It's going to be a long process, it's going to be difficult," the UN special envoy for Libya, Bernardino Leon, said.
"We are not expecting to have a breakthrough tomorrow or the day after tomorrow," said Leon, who is overseeing the dialogue in the Swiss city.
"There is a gap between the parties, which is becoming more complicated with more fighting on the ground."
Analysts warn that the negotiations are unlikely to have any real impact unless the leaders of all the armed groups -- some of whom are absent from the negotiations -- become directly involved.
The talks are aimed at reaching agreement on a unity government to replace the rival administrations, whose battle for power has left hundreds dead over the past six months.
They also seek to "put in place the necessary security arrangements for bringing about a total cessation of armed hostilities" and to "secure a phased withdrawal of all armed groups from all major towns and cities."
Libya's internationally recognised government decamped last summer to the eastern city of Tobruk after an Islamist-backed militia alliance seized the capital Tripoli and set up its own administration.
The alliance known as Fajr Libya (Libya Dawn) also holds the third city, Misrata. It launched a bloody offensive in December to seize control of key oil terminals but was repelled by the army.
Most countries pulled out their diplomats from Tripoli after the city was taken by Libya Dawn.
- 'Running out of time' -
Signup to our newsletter and follow us on Facebook and Twitter!
Although all factions are represented in Geneva, according to Leon, the Tripoli arm of Libya Dawn is holding out and will only take a decision on attending on Sunday.
"If you refuse to talk the only alternative is war. This is not acceptable to the international community and to many Libyans," Leon said, adding he hoped to start talking to "militias and military actors" in the conflict "as early as next week".
On Wednesday, representatives from the different factions mingled amicably and posed together for a large and smiling "family photo" before delving into the thorny talks.
Political analyst Mohammed al-Ferjani predicted however that the dialogue would fail "because the UN has not chosen the right actors".
"The participants are politicians and have no presence or influence on the ground," he said.
Leon warned that Libya was "running out of time" and the Geneva talks could be a crucial last-ditch bid to avert what he called "total chaos".
"Financial and economic collapse may be a matter of days or weeks," he said, adding that in addition there were "terrorist attacks... very strong fighting in different areas and some international calls for military intervention".
A UN diplomat voiced pessimism, saying: "There is a feeling that we are in the last-chance saloon with Libya and no one has a very attractive Plan B."
"There is a high risk of it failing," he said, speaking on condition of anonymity.
Representatives of the most powerful commander on the recognised government side, Khalifa Haftar, have not been invited to Geneva.
A former Kadhafi general turned rebel leader, Haftar established a militia in eastern Libya that was initially disavowed but later embraced by internationally recognised Prime Minister Abullah al-Thani.
Haftar has led repeated offensives against Islamist militias in Libya's second city Benghazi since May, which have succeeded in wresting back control of large areas.
Those militias are led by the Ansar al-Sharia group, blacklisted by the United Nations for its links to Al-Qaeda.
The battle for Benghazi, a city of about one million people, has killed hundreds of civilians, drawing repeated calls from the United Nations and Western governments for a ceasefire.
The Islamic State group that has seized large areas in Iraq and Syria is also thought to have gained a foothold in eastern Libya.