PARIS (Reuters) - Rival Libyan factions agreed on Tuesday on a declaration that would create a political framework to pave the way for U.N.-backed elections in December to end the country’s seven-year-old conflict.

FILE PHOTO: Prime Minister of Libya's unity government Fayez Seraj addresses the United Nations General Assembly in the Manhattan borough of New York, U.S., September 22, 2016. REUTERS/Eduardo Munoz/File Photo

The oil-producing nation splintered following the 2011 NATO-backed revolt that toppled Muammar Gaddafi, and since 2014 has been divided between competing political and military groups based in Tripoli and the east.

The United Nations is leading an effort to reunify Libya and to organize national elections. France under President Emmanuel Macron has sought to play a bigger role in coaxing the factions to end the turmoil, which has let Islamist militants gain a foothold and migrant smugglers flourish.

The Paris meeting, included eastern-based commander Khalifa Haftar, Tripoli Prime Minister Fayez Seraj, and the leaders of rival parliamentary assemblies, aimed to urge them to agree general principles for ending the conflict and moving toward elections.

The four stakeholders said they had agreed on a document to work constructively with the U.N. to realize credible and peaceful elections by Dec. 10 and abide by the results.

“Nobody says it will be a path layered with roses. The challenges exist and will continue to grow,” Seraj told a news conference.

“Last month there was a terrorist attack and there are a certain number of enemies to this democratic process.”

Slideshow ( 2 images )

The declaration was not signed as originally planned because the parties do not all recognize each other’s legitimacy and want to consult their home base, but they agreed in principle.

The eight-point document includes a call for the immediate unification of the central bank and the phasing out of parallel government and institutions. It makes a commitment to support the creation of a national army and encourage a dialogue on the issue in Cairo.

The parties committed to set the constitutional basis for elections and to adopt electoral laws by Sept. 16 with a view to holding legislative and presidential elections on Dec. 10.

TEXT CHANGED

Libya U.N. envoy Ghassan Salame said he would have his work cut out in the coming weeks, but that he saw a convergence between the will of the Libyan people and the international community.

“This convergence must not be lost,” he said.

The declaration also agrees to an inclusive political national conference, without setting a timeframe. Unlike an earlier draft, it no longer directly threatens international sanctions on those who impede the accord or dispute the outcome of elections.

Claudia Gazzini, senior Libya analyst for the non-governmental International Crisis Group, said the statement was more nuanced than earlier drafts, but set an “extremely optimistic” timeframe for elections and left unclear how the powers of a future president would be decided.

Past attempts at peace deals in Libya have often been scuttled by internal divisions among the country’s armed groups and by the different countries backing the local actors.

To tackle that, 20 countries and organizations were represented, including Italy, Turkey, United Arab Emirates, Qatar and Libya’s neighbors, who all have influence over different groups on the ground.

“By accepting these dates and a protocol, nobody will be able to say they don’t agree, because (all the protagonists) were here today,” Macron said at the news conference.