French Foreign Affairs Minister Jean-Yves Le Drian (L)

French Foreign Minister Jean-Yves Le Drian pledged his country's support for efforts to resolve Libya's political and security chaos during a visit to the war-wracked country.

Le Drian held talks in the capital Tripoli with the foreign minister of the UN-backed Government of National Accord, and then travelled to the east of the country, where he met military strongman Khalifa Haftar who backs a rival administration. 

"This is a signal of the commitment of France, of President (Emmanuel) Macron's will, to contribute to resolving this crisis," Le Drian told reporters in Tripoli.

He said the visit was a follow-up to a July 25 accord sealed in Paris between the GNA head Fayez al-Sarraj and Haftar.

"Our objective is the stabilisation of Libya in the interest of Libyans themselves but also in the interest of neighbouring countries, of which we form part in a way," Le Drian said at a joint news conference with Libyan counterpart Mohamed al-Taher Siala.

The French foreign minister said the aim was "a unified Libya with functioning institutions" that would stave off "the terrorist threat" and clear the way for reconciliation.

He met Haftar at his headquarters in second city Benghazi, the military strongman's spokesman Khalifa al-Abidi said, for talks on "national and international developments".

Libya has plunged into chaos since the overthrow of longtime dictator Moamer Kadhafi in 2011 with dozens of armed factions filling the power vacuum as people smugglers exploit the chaos to ferry migrants on unseaworthy ships across the Mediterranean to Europe.

At the July talks hosted by France, Sarraj and Haftar accepted that only a political solution can end the crisis, starting with a ceasefire.

In a 10-point statement, the leaders said: "We commit to a ceasefire and to refrain from any use of armed force for any purpose that does not strictly constitute counter-terrorism."

The two sides also committed to "building the rule of law", and integrating fighters into "lawful military forces".

Although the statement did not stipulate a date for elections, the French president said Sarraj and Haftar had "struck an agreement to hold elections next spring".

Following his German and British counterparts who visited Libya this summer, Le Drian also visited the eastern city of Misrata, home to some of Libya's most influential militias.

In Misrata he met with members of the municipal council and military figures and was also due to make a stop in the remote eastern city of Tobruk for talks with parliament speaker Aguila Salah.