CAIRO - Libya's rival leaders meeting for rare peace talks on Monday with Russian and Turkish officials in Moscow was a stark reminder of how the Libyan civil war has shape-shifted in recent months.
Russia and Turkey, which support opposing sides in the long-running conflict, have emerged as major players in Libya, largely outmaneuvering European powers that pressed for peace as violence in the strategic, oil-rich country accelerated.
Here's a look at the primary players on Libya's complex battlefield.
LIBYAN ARAB ARMED FORCES
Field Marshal Khalifa Hifter's self-styled Libyan Arab Armed Forces control much of eastern and southern Libya. His forces draw on Libyan army units, local militias and tribesmen. Since April, they have been trying to capture the capital, Tripoli, from Libya's weak U.N.-supported government. The escalating campaign has threatened to plunge Libya into violence rivaling the 2011 conflict that ousted and killed its longtime dictator Moammar Gadhafi.
A former general and Gadhafi ally, Hifter positions himself as a strongman who can restore order to the country and rid it of extremists. Despite his repeated calls for a final offensive against rival militias defending the capital, a chaotic stalemate reigns.
Hifter's east-based government, headquartered in the city of Benghazi, has gained the support of Egypt and the United Arab Emirates, as well as Russia and France.
UN-SUPPORTED LIBYAN GOVERNMENT
The Tripoli government, named the Government of National Accord, controls the capital and some of western Libya.
It was set up in 2015 by the United Nations under the leadership of technocrat Fayez Sarraj. While officially backed by the U.S. and other Western countries, the GNA now largely counts on Turkey for military assistance in its struggle to repel Hifter's forces. It also receives aid from Qatar and Italy.
For its protection, Sarraj's government has courted local armed militias, which also staff and control many of its institutions.
Russia has stepped onto Libya's battlefield and into the political vacuum left by Western powers. It allegedly dispatched late last year hundreds of mercenaries to boost Hifter's halting campaign to take Tripoli.
Libyan and U.S. officials accuse Russia of deploying fighters through a private security contractor, the Wagner Group.
Russia's intervention in crucial oil-producing Libya raises comparisons to its role in Syria, where the Kremlin has shored up the government of President Bashar Assad as it seeks to expand its influence across the Middle East.
Turkey has propped up the embattled GNA, becoming increasingly involved in a proxy war against regional rivals Egypt and the United Arab Emirates, which support Hifter's forces.
Turkey is seeking to safeguard its interests in the eastern Mediterranean as part of a broader competition for oil and gas drilling rights with other regional players. These include Greece, Cyprus, and Israel.
Ankara recently signed contentious maritime and military cooperation deals with the U.N.-supported government to create an exclusive economic zone across the Mediterranean, raising the financial stakes of its support for the GNA.
Last week, Turkish Parliament authorized a troop deployment to Tripoli, where it is already sending weapons and military experts.
As Libya's former colonial ruler, Italy has for decades cultivated close economic and political ties with the North African country located just across the Mediterranean from the Italian peninsula. Recent Turkish and Russian involvement has raised concerns in Italy over its waning influence.
When the war broke out, Italy bet on the Tripoli-based government to protect its stakes in Libya's vital oil facilities, including a natural gas pipeline, and to help stem the flow of migrants from Libya's Mediterranean coastline, which is a major conduit for thousands making perilous journeys to Europe.
Italy's policy of training and equipping the Libyan coast guard to intercept and divert Europe-bound smuggler boats to Libya has raised alarm among human rights activists. Traffickers in Libya run illegal detention centers notorious for abuse.
France's relationship with Hifter has put it at odds with other European countries that have professed support for the Tripoli government. Although it officially denies backing Hifter's forces, France views the general as a key political player and military chief whose control over most of Libya cannot be ignored.
France, which once colonized much of West Africa and still wields influence there, seeks to prevent Islamic extremists from gaining a foothold in the Sahel region, a potential powder keg it sees as threatening other North African countries and the Mediterranean.
The revelation last summer that French-owned missiles had been captured from Hifter's forces compelled the country to acknowledge its presence in Libya, although it denied violating a U.N. arms embargo.
Europe's division over Libya policy has hindered collective attempts to create a political solution.
EGYPT, UNITED ARAB EMIRATES
The United Arab Emirates and Egypt are longtime patrons of General Hifter, who they see as the best hope of stabilizing the troubled country and combating the Islamist threat on Egypt's porous western border. Despite a U.N. arms embargo, both countries deliver military aid to the LAAF, including powerful missiles and armed drones that have spurred Hifter's advances.
Germany, in the middle of a two-year stint on the U.N. Security Council, has taken a central role in trying to kick-start a diplomatic drive to end the conflict in Libya. As Germany scrambles to curb the flow of asylum-seekers after a large influx in 2015, it sees a stable Libya as crucial to dealing with the migration crisis at the source.
It has repeatedly offered to host a peace summit in Berlin for Libya's warring parties and their foreign backers. The goal is to find an end the 7-year civil war, halt foreign military interference and possibly move toward nationwide elections. But the diplomatic push has so far failed to yield results on the ground, and an exact date for the conference has not been announced.