Deadly clashes in Libya's capital this week underscore the huge challenges of holding planned elections later this year in the chaos-hit North African country, analysts say.
While a battle raged in Tripoli on Monday between rival militias, French President Emmanuel Macron reaffirmed his determination to see Libyans head to the polls.
He was behind a May meeting in Paris at which four Libyan leaders agreed to prepare the country for elections at the end of the year, despite ongoing instability.
Since the UN-backed Government of National Accord (GNA) was installed in Tripoli in March 2016, led by Fayez al-Sarraj, it has failed to impose its authority across the whole country.
The GNA is confronted with a hostile parliament elected in 2014 and based in the eastern city of Tobruk, as well as opposition from military strongman Khalifa Haftar whose self-styled Libyan National Army dominates the country's east.
Despite all three leaders being present in Paris, along with Khalid al-Mishri, head of the High Council of State in Tripoli, other influential Libyan actors were notably absent.
- Militias have 'taken over' -
Even as the GNA pushes forward with plans for an election, it remains unclear whether officials will be able to establish the necessary security for a nationwide vote.
The internationally recognised government has not been in a position to form an army of its own and swathes of Libya remain in the hands of dozens of different armed groups.
Militias benefitted from the chaos which ensued after the ousting of dictator of Moamer Kadhafi in 2011 and have since become powerful actors.
"Unfortunately, in the last seven years, the armed groups have taken over in Libya," said Federica Saini-Fasanotti, from the Brookings Institution think tank in Washington.
"They control the territory and are so strong that they can threaten those who should, instead, govern them," she said, arguing militias have been "legitimised" by officials.
In the latest flare-up of violence, two militias linked to the GNA faced off in residential areas of Tripoli on Monday. Five people were killed and 33 wounded, according to the health ministry, before a truce was reached.
Small Arms Survey, a Geneva-based NGO, found that over the past two years Tripoli's militias have "transformed into criminal networks straddling politics, big business, and the administration".
"They have infiltrated the bureaucracy and are increasingly able to coordinate their actions across different state institutions. The government is powerless in the face of militia influence," the organisation said in a June report.
Khaled el-Montasser, an international relations professor at the University of Tripoli, said the recent clashes demonstrated the failure of a political accord signed in Libya in December 2015.
The pan-Libyan deal signed in Morocco paved the way for militias to be dismantled and for Libya's largest cities to be cleared of heavy weapons.
"It's necessary to put in place a special security force tasked with protecting state institutions and preparing a favourable climate for elections to take place," said Montasser.
- Disagreements in parliament -
While security remains a vital factor in holding a vote, the Paris accord also foresaw the creation of an electoral law and the constitutional base for elections by September 16.
Numerous Libyan actors have demanded a draft constitution be prepared and put to a referendum, ahead of an election, but lawmakers in Tobruk have so far failed to agree on the text.
Parliamentary sessions have repeatedly been adjourned due to lawmakers arguing over the legal text to organise a referendum, and on Monday MPs failed to get the necessary number to adopt the law.
Speaker Aguila Saleh Issa said that if they fail to reach quorum on Monday, he would apply a decision taken by the assembly in 2014 which would allow the direct election of a "temporary president" until the adoption of the constitution.
But decisions taken by the Tobruk-based parliament are often challenged by its rivals in the west of the country, analysts say, and therefore have little chance of success in the absence of a wide consensus.