Libya peace accord
Libyan rivals sign peace deal as Tripoli Islamist government stays awayEsam Al-Fetori/Reuters

Warring Libyan factions have signed a UN-brokered peace accord in Morocco after months-long negotiations even as the Islamist government in Tripoli stayed away.

Representatives and leaders of the rival groups have agreed to form a unity government within one year alongside an immediate ceasefire.

"They [Libyan government] have also played a critical role in this text. As I have said many times, there is no text that is entirely satisfactory to all parties and that responds to all their demands... I am confident that in the weeks ahead a clear decision will be made and will address all sides and issues," said UN special envoy to Libya, Bernardino Leon.

Multiple groups have been trying to take control of the oil-rich nation, which has been reeling under an intense power struggle for four years ever since former dictator Muammar Gaddafi was ousted.

The agreement has the backing of the internationally-recognised government, which is based in the eastern port city of Tobruk, but not the Islamist administration which runs a parallel government in Tripoli.

"This agreement will bring a step, an important step in the road of peace in Libya. Let me enhance one message: The doors will remain open for those who have chosen not to be here," Leon said in his address during a gathering of both Western and Arab delegates.

A one-year transitional period will allow the groups to work out a framework on who will take control of key establishments like airports. They are also expected to come up with a constitution during this period.

"We are still in the dialogue, but we don't really understand why they are rushing to sign before all the parties agree," Mowafaq Hawas, a spokesperson for the General National Congress (GNC) said, according to Reuters.

The deal has come at a crucial time when the Islamic State (Isis) is increasingly attempting to capitalise on the political vacuum created by the unrest in the North African nation.