"This is a step, but it is really an important step along the path to peace," UN envoy Bernardino Leon said at a ceremony yesterday in the Moroccan resort of Skhirat marking the agreement.
The deal was backed by members of Libya's internationally recognised parliament, based in the eastern port city of Tobruk, as well as representatives of political parties, municipalities and civil society groups.
Libya has been plunged into chaos since the 2011 overthrow of dictator Moamer Kadhafi, and now has two parliaments and governments vying for power.
Leon said the door remained open to groups that did not attend, and added that remaining contentious issues could be discussed after the conclusion of the holy Muslim fasting month of Ramadan this month.
Among these issues are a call for "respecting the judiciary", a possible reference to a Supreme Court decision invalidating the parliament in the east, which was elected in June 2014.