Libya’s two opposing governments have signed a United Nations-brokered deal in Morocco aimed at uniting the two factions.

It comes four years after the fall of Muammar Gaddafi, prompting coalitions of former militants and rebels to establish a self-stated government in the capital of Tripoli. Another internationally recognised faction was established in the east after Gaddafi’s fall, raising heavy tensions between the two groups.

Nearly 80 of 188 Members of Parliament from the Libya’s internationally recognised government signed the agreement, with 50 of 136 members of the General National Congress following suit in signing the deal.

The agreement will call for the formation of a 17-member single government of National Accord to be headed by businessman Fayez el-Sarraj as Prime Minister, and national institutions that will ensure broad representation of the community.

Hailed as “an historic day” by UN official representatives, the agreement will put Libya back on the back of building a democratic State surrounded by the principles of inclusion, human rights and the rule of law.

UN Secretary-General Ban Ki-moon welcomed the move as the essential building blocks towards a peaceful, secure and prosperous Libyan government.

“It is a critical step in continuing Libya’s post-revolution transition after months of turmoil and uncertainty,” he said. “We will continue to work to broaden the basis of support for the new government."

The deal has also been praised by western UN delegates in hopes the agreement will bring balance to the nation and ease the presence of Islamic State militants.

Amid the chaos of constant civil wars in Libya, IS forces have slowly expanded their forces to take over the city of Sirte. Hotels and prisons have been attacked in Tripoli, oilfields have been ransacked and Egyptian Christian groups have been executed as part of the terror organisation’s regime.

How the deal will actually impact Libya is still uncertain.

Members of each faction rejected the proposals by not signing them, and questions still remain on how the deal will be implemented between rival armed militaries that each hold the key to power.

Although welcomed by the diplomats and NATO, UN envoy Martin Kobler recognized there is still much work needed in order to end the strife in Libya.

“Signing is only the first step on the road to putting Libya back on the right track,” he said. “The new government must move urgently to address the concerns of those who feel marginalised."

Contact the writer at feedback@ibtimes.com.au or tell us what you think below.