PARIS — French President Emmanuel Macron will host a meeting of the two main rival leaders of chaotic Libya, his office said Monday, to try to “contribute to an end to the Libyan crisis,” which is feeding Islamic militants, people traffickers preying on migrants and instability in the region.

The head of Libya’s unity government, Fayez Sarraj, and Gen. Khalifa Hifter, the Egyptian-backed commander of Libya’s self-styled national army, are to meet on Tuesday at a chateau in La Celle Saint-Cloud, outside the French capital, the presidential Elysee Palace said. However, the two were already in Paris a day before the encounter hard at work with French experts to find common ground.

Macron is to meet separately with the U.N.-backed Libyan prime minister and the general, who has the support of the internationally recognized parliament in the country’s east, before the two hold a face-to-face encounter with the U.N.’s newly appointed special envoy for Libya, Ghassan Salame.

French officials hope the two can agree on a joint declaration, “simple but constructive,” an official in the French president’s office said. The official could not be named in keeping with presidential policy.

Among other things, the text would say, it is hoped, that there can be no military solution to the Libyan crisis. It would also lay down the principle of a cease-fire — except for fighting Islamic militants, the official said.

A joint declaration, while not a political accord, would be a first for the rivals, who have met in the past, most recently in May in Abu Dhabi. Still, the idea of the Paris encounter is not to find a solution to the Libyan crisis. Salame, the U.N. envoy, would make other proposals in the weeks ahead.

After the May encounter in the United Arab Emirates, the hosts said there had been a “significant breakthrough.” Libya TV said the men agreed on holding presidential and parliamentary elections next year in the fractured country.

Asked if such an eventuality would not be premature, another official at the French presidency said that was not the goal of the Paris encounter but any such decision between the rivals should be encouraged.

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 fractious country, a statement by the president’s office said. The challenge, the statement added, is to “build a state capable of responding to the fundamental needs of Libyans” with one regular army.

That’s far from the current situation, in which rival governments and militias have battled for supremacy since Libya descended into chaos following the 2011 civil war that toppled and killed dictator Moammar Gadhafi.

Political agreement in Libya is widely viewed as the key to ridding the country of extremist groups, and arms and people trafficking. France, and Europe, see the return of a stable nation as vital to controlling its borders — and cutting off the flow of migrants to Italy and, more broadly, ending its status as a danger zone for Europe. Macron has made progress on both fronts a priority.

Sarraj is the prime minister of the U.N.-backed government in Tripoli, the Libyan capital, and Hifter, a powerful general backed by Egypt who lived for years in the United States, is fighting Islamic militants and is backed by parliament.