Prime Minister Fayez al-Sarraj, the leader of the United Nations-backed government in Tripoli, and Gen. Khalifa Haftar, the commander of the so-called Libyan National Army which controls parts of the east of the country, met with the French President at a chateau in La Celle Saint-Cloud, west of Paris. Ghassan Salamé, the new special representative of the United Nations Secretary-General, also took part in the discussions Tuesday.
"Today, the cause of peace in Libya has made great progress," President Macron tweeted.
The talks ended with a 10-point joint declaration backed by the two Libyan rivals.
The two leaders said they recognized that the "solution to the Libya crisis can only be a political one and requires a national reconciliation process involving all Libyans," according to the statement released by the Élysée Palace.
The declaration also included a commitment to "work towards the holding of presidential and parliamentary elections as soon as possible ... in cooperation with the relevant institutions and with the support and under the supervision of the United Nations."
The two rivals pledged a "ceasefire and to refrain from any use of armed force for any purpose that does not strictly constitute counter-terrorism..."
Earlier Tuesday, the French President's office acknowledged it had prematurely released a statement outlining the deal. It released the new statement hours later.
Sarraj and Haftar had not met since failed talks in the United Arab Emirates in May.
Both men have been involved in the struggle for power in Libya, which descended into chaos after former dictator Moammar Gadhafi was toppled in 2011.
France played a leading role in the international intervention in Libya. All parties, including those countries that neighbor Libya, were keen to secure a peace deal and work toward ending the migrant crisis, with Libya often used as a gateway to Europe.
Macron has sought breakthrough
Since winning the French presidency in May,
Macron has been keen to help bring about a lasting peace in Libya.
Macron has not been shy in embracing the international stage, hosting Russian President Vladimir Putin and US President Donald Trump since taking office.
His latest attempt is to bring an end to the crisis which has engulfed Libya.
The country has been beset by internal divisions since Gadhafi was overthrown six years ago, a move which led to the collapse of the economy and vital oil production as well as the emergence of ISIS.
Sarraj has the backing of the UN in the Libyan capital. But Haftar, who rejects Sarraj's government, remains in control in the eastern city of Tobruk, and his forces liberated the city of Benghazi last month after three years of fighting Islamists.
The refugee issue
One of the most problematic issues facing Libya and Europe is the flood of refugees making the dangerous crossing between the two.
According to the UNHCR, 2,171 refugees and migrants died or went missing in the Central Mediterranean in the first six months of 2017.
The UNHCR says that around 89% of those attempting to cross
the Mediterranean depart from Libya. Some 90,000 people made the journey in the first seven months of this year.
Many of those attempting to make the trip are aiming for Italy, which is desperate for a solution to instability within Libya.
According to the International Organization for Migration
, 93,417 people arrived in Italy between January 1 and July 23.