Libyan Prime Minister Fayez al-Sarraj and General Khalifa Haftar declare a ceasefire on July 25, 2017. Michel Euler / AP

Libya’s two leading political rivals, Prime Minister Fayez al-Sarraj and General Khalifa Haftar, agreed to a ceasefire and fresh set of elections on Tuesday following talks hosted by French President Emmanuel Macron in a suburb west of Paris. While Sarraj is the leader of Libya’s UN-backed interim government in Tripoli, the Government of National Accord (GNA), Haftar maintains control over the Libyan National Army and eastern city of Tobruk. As the leader of the Tobruk government, Haftar has refused to support the prime minister, whom he accuses of threatening Libya’s stability. The two leaders previously met in Abu Dhabi for a failed round of peace talks in May.

On Tuesday, Sarraj and Haftar jointly announced they had agreed to a nationwide ceasefire, calling for an end to the use of armed force in Libya, except in the fight against terrorist groups. Since the fall of former Libyan dictator Moammar Gadhafi in 2011, large swathes of the nation have become vulnerable to Islamist militant groups, including ISIS and Ansar al-Sharia, which rose to power during the First Libyan Civil War. In the years since, Libya has been plagued by violence and instability as rival groups wrestle for control over territory while combatting the growing threat of terrorism.

Although the 2015 Libyan Political Agreement recognizes Sarraj’s government as Libya’s sole legitimate executive body, the GNA has struggled to assert its authority in the region, particularly in the absence of its own security force. Meanwhile, Haftar’s government—backed by Egypt, the United Arab Emirates, and a large portion of the French military—has managed to capture two thirds of the country, including wresting the eastern capital of Benghazi from militia control.

Having declined to recognize the GNA, Haftar has called for a new set of general elections to be held by early 2018. On Tuesday, the two leaders reached a compromise, agreeing to hold presidential and parliamentary elections “as soon as possible … with the support and under the supervision of the United Nations.” On the same day, Macron confirmed that elections would likely be held in spring 2018. “The cause of peace has made great progress today,” Macron said on Tuesday, adding that Sarraj and Hafta demonstrated “historic courage” by reaching an accord. The French president later tweeted a video of himself shaking hands with both Libyan officials with the caption: “Libyan people deserve this peace. We owe it to them.”

While Macron has insisted that “civil war in Libya is not inevitable,” many suspect that a ceasefire agreement will be difficult to enforce among militia groups who are not loyal to either side. Just hours after the ceasefire was reached on Tuesday, The Guardian reported that Libya’s Justice and Construction political party had rejected the terms of the agreement, saying they would only honor a resolution mediated by the UN. Aside from Haftar, leaders of the Tobruk government were also absent from Tuesday’s negotiations, and may be reticent to approve a deal.

Still, many western leaders are determined to achieve lasting peace in Libya—especially with the nation’s migrant crisis spilling over into neighboring countries. So far this year, the UN Migration Agency reports that more than 93,400 migrants and refugees have arrived in Italy, with the vast majority of them hailing from Libya. On Monday, the agency said that more than 11,000 migrants had been rescued in Libyan waters since January, while nearly 350 men, women, and children were found dead on Libyan shores.

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.