Members of Libya's rival parliaments on Thursday signed a landmark, U.N.-sponsored deal on forming a unity government that will strive to bring peace to the war-ravaged country.
Supporters of the agreement hope that rival political factions and militias will embrace the deal and agree on a cease-fire, so that they can fend off the Islamic State in Iraq and the Levant (ISIL), which is expanding its gains in the North African country.
The document was signed in Morocco by Emhemed Shoaib, the deputy speaker of the internationally recognized Libyan parliament, and Salah al-Makhzoum, the second deputy of the parliament based in the capital, Tripoli.
In the four years since Muammar Gaddafi was killed, Libya has steadily splintered into rival fiefdoms. Over a year ago, it was further torn — in addition to having two parliaments — between the internationally recognized government, based in the country's east, and the government in Tripoli.
The United Nations deal calls for a unity government and a cease-fire that will open the way for international aid and training to rebuild the OPEC oil-producing state.
"We have reached an agreement, but the biggest challenge now is to implement it," said Salah Huma, a parliament member and negotiator for the eastern government, said before the signing.
Al-Makhzoum said while the deal is not perfect, it's a step to rescue Libya from collapsing and ensure its unity.
"This is just the beginning of a long journey for Libya," said U.N. envoy Martin Kobler, who attended the signing ceremony in Morocco. "Signing is only the first step on the road of putting Libya back on the right track."
Western officials believe war fatigue, promises of foreign aid, the strain on Libya's oil economy and the common threat posed by ISIL will help build momentum for the national government and bring opponents onboard.
The agreement has detractors on both sides who seek a separate deal without U.N. involvement.
The speakers of the two parliaments — Tripoli-based Nuri A.M. Abusahmain and Aguila Saleh Issa from the east — were not at the Morocco ceremony. The two, who are seen by analysts as hard-liners, held talks on Tuesday in Malta to forge a separate deal without U.N. involvement.
Afterward, they issued a statement saying the representatives who traveled to Morocco were not mandated to represent the parliaments in the talks.
Before the start of Thursday's ceremony, Al-Makhzoum and Faraj Abu-Hashem, the spokesman for the east-based parliament, told The Associated Press that 88 lawmakers from the two parliaments were present at the signing.
The eastern parliament has 156 known members, while the rival parliament in Tripoli has 135.
The foreign ministers of Turkey, Italy, Spain, Qatar, Tunisia, and Morocco also spoke at the ceremony in support of the deal.
Among the first to welcome the deal was French Foreign Minister Laurent Fabius, who praised the accord and promised to support efforts by a new unity government.
"The priority should now go toward creating a national unity government," he said in a statement. "That's the condition for tackling terrorism and trafficking that threaten the security of the region and Europe."
Since the 2011 uprising led to the ousting and killing of Gaddafi, Libya has struggled with almost constant instability as heavily armed brigades of former rebels and their political allies squabbled for control.
Battered by protests and attacks, oil production that accounts for most government revenue is now less than half of the 1.6 million barrels per day level prior to 2011.
But last year, fighting intensified when one armed faction took over Tripoli, set up its own government and reinstated the old parliament, the General National Congress. Since then, the recognized government and elected House of Representatives operate out of the east of the country.
In the chaos, Islamic State fighters have reportedly expanded their presence, taking over the city of Sirte, attacking a hotel and a prison in Tripoli, ransacking oilfields to the south of Sirte and executing a group of Egyptian Christians.