Libya's rival leaders agreed to hold parliamentary and presidential elections on December 10 following a meeting in Paris.
"The parties have committed to set the constitutional basis for elections and adopt the necessary electoral laws by September 16, 2018, and hold parliamentary and presidential elections on December 10, 2018," said a joint statement.
Libyan Prime Minister Fayez al-Sarraj said he was happy with the outcome of the meeting and was keen to see the agreement ratified by all stakeholders.
"We reaffirm the existence and the need for a constitutional basis to organise an election and the need for everyone to work hand-in-hand to make sure the elections are a success," Sarraj said in a press conference shortly after the meeting.
Sarraj added that he had called on other rival leaders who attended the meeting to bring an end to the civil war in the country and put an end to the bloodshed in Libya.
Libya splintered following the 2011 NATO-backed revolt that toppled Muammar Gaddafi. Since 2014 the North African nation has been divided into competing political and military factions based in Tripoli and the east.
The United Nations is leading an effort to reunify the oil-rich country and to organise national elections.
The Paris meeting, which included eastern-based commander Khalifa Haftar, Tripoli Prime Minister Sarraj, and leaders of rival parliamentary assemblies, aimed to urge them to agree to general principles for ending Libya's crisis and moving towards elections.
"Positive that all Libya parties present at Paris conference agreed [to a] timeline leading to elections in December," Malta's Prime Minister Joseph Muscat said from inside the meeting. "Let us hope, and help them in keeping this important commitment.
Al Jazeera's Mahmoud Abdelwahed, reporting from Libya's capital, Tripoli, explained that the elections in Libya could be part of the solution, however, the process still has "a long way to go" as many of Haftar's opponents and other strong key players in Libya were not included in the talks.
"[These] groups are very strong on the ground and they have power. Among them for example, is the armed group that defeated ISIL in the west of Libya and in the city of Sirte," Abdelwahed said.
"There are so many troubled areas all over the country. For example the eastern city of Derna has been suffering for the last three years at the hands of Haftar's forces [due to a siege placed on the city]."
Libya is split between rival governments in the east and west, each backed by an array of armed groups.
Representatives of Egypt, Russia and the United Arab Emirates, which have backed Haftar and the rival administration in Tobruk in the east, also attended.
France is trying to play peacemaker in a country where years of efforts by the United Nations and former colonial power Italy have failed to bring stability.
French President Emmanuel Macron brought the two rival Libyan leaders Sarraj and Haftar together at a meeting near Paris last July. They committed themselves to working towards presidential and parliamentary elections.
The International Crisis Group warned the Paris conference might unintentionally undermine the UN-led peace process.
"French organisers should avoid imposing too rigid a framework," the group said in a statement on Monday.