PARIS (Reuters) - Khalifa Haftar, Libya’s eastern military commander, has told France’s president he will sign a ceasefire and stick to it if militias backed by the internationally recognised government respect it, a French presidency official said on Monday.

“Marshal Haftar assured (us) that he was committed to signing the ceasefire but this commitment would cease if the militias do not respect it,” the official said after Haftar met President Emmanuel Macron in Paris.

The official gave no further details.

Despite a peace conference held in Berlin in January, violence has increased in Libya, with combatants in the west and east preparing for a long conflict as foreign weapons flood in, eastern factions close oil ports and rival alliances wrangle over revenues from Africa’s largest petroleum reserves.

Several countries backing rival factions in Libya have violated an arms embargo, according to the United Nations, which has previously named the United Arab Emirates, Egypt and Turkey for breaching the embargo.

After the Berlin conference the violations increased and the U.N. denounced them without naming countries.

The Libyan National Army led by Haftar and forces aligned with the internationally recognised Government of National Accord (GNA) in Tripoli have been fighting for control of the capital since April last year.

The UAE and Egypt support Haftar, while the GNA is backed by Turkey. France has been accused of lending political support to Haftar, but Paris has denied this.

“Haftar is one of the main actors on the Libyan political scene and must be taken into consideration,” the French presidential official said.

The official said there were no plans for Macron to meet or speak to the head of the Tripoli government, Fayez Seraj.

The standoff over oil is one of several factors that could prolong the almost year-long conflict over the capital, where the GNA last month secured military backing from Turkey including Turkish-backed fighters from Syria.

The official said Macron had raised the issue of oil and moves to ensure the revenues serve all the population and lead to blockades of ports being lifted, but Haftar said it had nothing to do with him.