Macron said Libya’s UN-backed Prime Minister Fayez al-Sarraj and Khalifa Haftar, the military strongman whose forces control large areas of the east of the country, had displayed “historic courage” at the talks outside Paris.
"France’s aim is to contribute to drawing up a political solution and helping the Libyans strengthen the Skhirat inter-Libyan political agreement to make it more effective and inclusive," a French presidential statement said.
Libya has been deeply divided since the 2011 uprising, with numerous militias holding territory and rival administrations vying for their allegiance in often bloody confrontations.
The UN-backed Government of National Accord (GNA) set up base in the capital Tripoli at the end of March 2016 but is struggling to assert its authority across the country.
It controls most of the west but in the east a rival administration backed by military strongman Haftar holds sway.
The rival leaders committed themselves to a political solution to the situation in their country and called for a "national reconciliation process of all Libyans".
"We commit to a ceasefire and to refrain from any use of armed force for any purpose that does not strictly constitute counter-terrorism, in compliance with the Libyan political agreement and international treaties, and in order to protect Libya’s territory and sovereignty and we strongly condemn all that threatens the stability of the territory," their joint statement said.
They promised to work together to organise elections "as soon as possible".
The two leaders have already met, in Abu Dhabi in May, but without any concrete results.