World powers have urged the warring factions to break a political deadlock that has allowed jihadists and people-smugglers to flourish since the fall of dictator Moamer Kadhafi in 2011.
A group of lawmakers from Libya's rival parliaments, as well as other political figures, inked the UN-sponsored accord in the Moroccan resort of Skhirat, an AFP journalist said.
Around 80 of 188 lawmakers from Libya's internationally recognised parliament and 50 of 136 members of the General National Congress (GNC) signed the deal, participants said.
The heads of both of them have warned that the accord has no legitimacy and that those who signed it represented only themselves.
More From This Section
UN envoy Martin Kobler acknowledged that much remained to be done to end the turmoil.
"This is just the beginning of a long journey for Libya. Signing is only the first step on the road to putting Libya back on the right track," he said at the ceremony.
"The door is always open to those who are not here today. The new government must move urgently to address the concerns of those who feel marginalised."
Nouri Abusahmein, who heads the militia-backed GNC in Tripoli that is not recognised by the international community, said yesterday that the signatories did not represent the parliaments.
"Whoever has not been commissioned by the GNC to sign or initial a deal on its behalf is, and will remain, without legitimacy," he said.
A government such as that proposed by the United Nations "is not the subject of consensus and does not even guarantee the minimum required to ensure its effectiveness", he added.
It was the first time they had met since the rival administrations were formed in 2014.
And both of them said that whoever was to sign the agreement represented only themselves.