The breakthrough came at an international conference in Paris
Libya's rival factions have agreed to hold presidential and parliamentary elections on December 10.
Four senior Libyan officials met in Paris for talks hosted by French President Macron.
The participation of the main parties in this conference is in itself a positive step," said Fayez al-Sarraj, the prime minister of Libya's National Unity Government. "All the parties announced, in different versions, their agreement to hold parliamentary and presidential elections next 10th December."
The talks were also attended by representatives of 20 countries as well as the UN's special envoy for Libya. The aim was to find a way out of the chaos the country has suffered over the past seven years.
French President Emmanuel Macron praised the efforts of the Libyans:
"It is the first time that in this format here, these leaders, some of whom do not recognise each other mutually, got together, decided to work together and who have, as you saw, approved a common declaration."
The Libyan leaders agreed to a statement that called for the phasing out of parallel governments and institutions and that anyone who interfered in the election process would be held to account.