The attempted offensive by Libyan strongman Khalifa Haftar on Tripoli has thrown into sharp relief the divisions between world powers over how to end the chaos that has riven Libya since the 2011 overthrow of Moamer Kadhafi.
Over the last years, competing factions and militias have sprouted up controlling different parts of Libya, leaving foreign powers to back or oppose a sometimes bewildering array of groups.
Haftar's controversial and surprise offensive on Tripoli, launched last week, has forced interested parties to lay their cards on the table about what they believe is the best way to restore order in the north African country.
Where do key regional powers in the Gulf, Turkey, neighbour Egypt as well as Russia and key EU players France and Italy stand?
Egypt, Saudi and UAE: Haftar's allies
On one side of the struggle is Haftar, the military commander and strongman of eastern Libya. And on the other Fayez al-Sarraj, who leads the United Nations-endorsed Government of National Accord, which has control of Tripoli.
The key allies of Khalifa are the United Arab Emirates, Egypt and increasingly Saudi Arabia while he is strongly opposed by their regional foe Qatar as well as Doha's chief supporter Turkey.
"The fighting in Libya has turned into a proxy war between Gulf rivals," according to James Dorsey, a senior fellow at the S. Rajaratnam School of International Studies in Singapore.
Neil Partrick, a Middle East specialist based in Britain, told AFP that Haftar has had the support of Egypt and the United Arab Emirates from the outset while recently Saudi Arabia began openly backing him as well.
Previously Riyadh had been "discretely backing" Haftar while publicly professing political support for the UN-backed government in Tripoli.
But the strongman was invited to visit Riyadh in March in a show of support, Partrick said.
Italy, Turkey and Qatar: Friends of Sarraj
On the other side of the fight, the UN-backed Sarraj government retains substantial support from Italy, which has close ties with and strong economic interests in its former colony.
"Historically, the Italians have always maintained very good relations with Tripoli," said Ali Bensaad, professor at the French Institute of Geopolitics, pointing to Italy's interests in Libyan energy reserves through its oil firm ENI.
In addition to Italy, Sarraj has backing from Turkey and Qatar, "but a Qatar that is currently weakened by its (diplomatic) isolation" due to the blockade from other Gulf nations, particularly Saudi Arabia and the UAE, according to Bensaad.
The support of Rome, a colonial power in the early 20th century, also has a lot to do with its "priority (of) ending the flow of migrants" coming from Libya, said Arturo Varvelli, head of the North Africa Program at the Italian Institute for International Political Studies in Milan.
France and Russia: ambiguous games
For its part, France has ostensibly played the role of mediator between Haftar and Sarraj, organising two meetings between the Libyan rival leaders, one in July 2017 and the other in May 2018.
But in reality the French position is less clear, and Paris -- which maintains close ties with Cairo, Riyadh and Abu Dhabi -- has been accused of favouring Haftar's side in the power struggle.
"France is no longer playing the role of mediator," said Bensaad. "Its strategic alliance with the Gulf countries is pushing it to mould its geopolitical strategies."
In July 2016, France announced the death of three soldiers in a helicopter accident in Libya, where they had been supporting Haftar's forces during an intelligence-gathering mission.
"The French position is ambiguous," said Varvelli, arguing Paris had from 2015 "endorsed Haftar to demonstrate French commitment to the fight against radical Islamists."
French involvement in Libya under President Emmanuel Macron has caused tensions in the past with Italy, which has historically been the lead European power in the country.
"France and Italy are on the same wavelength," French Foreign Minister Jean-Yves Le Drian claimed on Saturday.
Meanwhile, Russia has been seen as an enthusiastic supporter of Haftar, hosting meetings with him in Moscow.
But since his offensive, Moscow has in public at least distanced itself from the military strongman, with the Kremlin calling "on all sides to reject actions that could provoke bloodshed in battle and the deaths of civilians".
"If he (Haftar) wants to maintain an internal and international legitimacy, he cannot afford a bloodbath," said Varvelli.