LA CELLE SAINT-CLOUD, France — Two rival Libyan leaders committed themselves on Tuesday to a cease-fire, working toward presidential and parliamentary elections, and finding a road map to secure lawless Libya against terrorism and trafficking of all kinds, according to a document released by the French presidency.
The meetings at a chateau in La Celle Saint-Cloud, west of Paris, brought together Fayez Serraj, prime minister of the UN-backed unity government, and General Khalifa Hifter, the Egyptian-backed commander of Libya’s self-styled national army. French President Emmanuel Macron met separately with each ahead of the session between the two Libyans in the presence of the UN’s newly appointed special envoy for Libya, Ghassan Salame.
‘‘There is political legitimacy in the hands of Mr. Serraj. There is military legitimacy in the hands of Mr. Hifter. They have decided to work together,’’ Macron said.
The 10-point joint declaration that capped the encounter was the first of its kind since Libya spiraled into chaos after the 2011 toppling and killing of leader Moammar Gadhafi.
Among the points agreed upon was a commitment to a cease-fire with armed force reserved ‘‘strictly’’ for use in counter-terrorism operations.
The rivals also ‘‘solemnly commit to work towards the holding of presidential and parliamentary elections as soon as possible.’’
The French president said later that the goal is for balloting in the spring.
Macron’s bid to work toward laying the groundwork for a state with a functioning government and institutions is a priority of his presidency.
Talks were centered on creating a propitious climate for elections next year, security and military issues, respect for human rights, and economic development of the oil-rich nation where residents struggle despite the resources, French officials said.
Macron, Salame, and Serraj, along with French Foreign Minister Jean-Yves Le Drian, walked into the chateau to begin the first set of talks after shaking hands before Republican Guards in their ornate gear. Hifter arrived later.
The encounter was never expected to resolve the knotty problems of Libya, politically fractured and awash in militias and human traffickers preying on migrants who use the Libyan coast as a jumping off point to Europe, mainly Italy. But it was seen as a way to lay the basis for the UN envoy to come up with proposals in the weeks and months ahead.
Paris has made clear that the French initiative is not meant to brush aside numerous initiatives by others, including the European Union, the African Union, and individual countries, like Morocco.
France ‘‘wants to facilitate a political entente’’ and ‘‘mark its support for efforts to build a political compromise, under the auspices of the United Nations,’’ that includes all actors in the country, a statement Monday by the president’s office said.