The United Nations says that members of Libya's two rival governments have signed a U.N.-brokered agreement in Skhirat, Morocco, meant to unify them into one.

This comes after months of U.N.-led diplomacy between the two governments and other stakeholders.

U.N. envoy Martin Kobler hailed this as a turning point in Libya's history:

"After a period of political divisions and conflict, Libya is restarting its political transition. The agreement puts in place a single set of legitimate institutions — essential building blocks towards a peaceful, secure and prosperous Libya."

A video posted on Twitter by the United Nations Support Mission in Libya, titled, "Now: Signing of the Libyan Political Agreement in the City of Skhirat, Morocco," shows delegates and spectators jubilantly chanting at the ceremony.

But it's unclear how the agreement will actually impact lawless, war-weary Libya, which is torn between an internationally recognized government based in the east of the country and an Islamist militia-backed government in the capital Tripoli.

Jamal Zubia, a spokesperson for the Tripoli-based government — the one that is not recognized by the international community but rules the capital — told NPR's Leila Fadel that those claiming to represent the government in the deal are not true representatives.

Fadel says parliaments in both rival governments have rejected the deal as details emerged in recent days.

Ahead of the signing, Claudia Gazzini from International Crisis Group told France 24 that these delegates are therefore agreeing to its terms on an individual basis, and the two rival parliaments are not signing on "in an institutional manner":

"The risk is that by not having an institutional vote and by only having individual members signing on to the agreement, you can have further institutional chaos in the country."

Gazzini says that could mean three governments existing simultaneously, referring to the two that already exist and the unity government coming out of this deal.

Copyright 2016 NPR. To see more, visit