Libya risks losing its final chance to find a peaceful solution to four years of deadlock because political parties backed by the west are plotting to hijack crucial talks, a former Libyan diplomat has told the UN.

The warning from the country’s former ambassador to the UN Ibrahim Dabbashi was issued in an open letter to Ghassan Salamé, the UN special envoy for Libya.

Salamé is hoping to hold a national conference this month before presidential and parliamentary elections due by the summer, which are designed to bring the war-torn country back together.

Dabbashi said in his letter, published on Monday, that “some Libyan parties backed by the active members of the UN security council are trying hijack the national conference”.

He said Salamé should not be fooled by these groups, which he said already occupy the chaotic political scene and were seeking to flood the meeting to maintain their power, rather than find a long-term political solution. He said the UN needed to bypass them, ideally through municipal councils.

The conference was a last chance for the UN mission to restore its credibility and for Libya to achieve a peaceful transition, Dabbashi said. The UN has not yet announced an agenda, format or timetable for the conference.

Dabbashi’s warning came as suggestions mounted that Khalifa Haftar, the strongman who is the dominant figure in Libya’s east, is determined to reunify the country militarily, if necessary by staging an assault on the capital, Tripoli.

Salamé said Haftar, the head of the self-styled Libyan National Army, is committed to the political process.

But Haftar has been at loggerheads with the UN-backed Government of National Accord, led by Fayez al-Serraj for more than four years, splitting Libya’s chief institutions including the central bank, the government and security forces.

While Dabbashi did not explicitly state which foreign powers he was accusing of interference, Haftar’s allies are primarily Egypt, the United Arab Emirates and increasingly France, while the GNA government is dependent on Qatar and, in recent months, Turkey.

Over the past year, Haftar, presenting himself as capable of defeating jihadists and the Muslim Brotherhood, has been slowly building diplomatic support in Paris and Rome, alongside his longstanding allies in Cairo and the UAE.

The prospects of the UN holding free and fair elections this year depend on securing stability in the country, but fighting continues, including in the south, the port of Derna, sporadically in Tripoli, as well as south of Sirte.

The GNA’s ministry of foreign affairs in the capital was attacked by Islamic State fighters on Christmas Day, leaving two people dead.

Salamé is hoping increased oil revenues, exhaustion at political infighting and UN support can persuade Libyans to accept the outcome of the elections.

The interior minister, Fathi Bashagha, installed in October, told BBC Arabic that elements of the Tripoli militia were running a parallel operation inside his ministry, executing their agendas away from the government’s orders.

“We have now a parallel interior ministry in Tripoli,” he said, claiming they had a huge amount of money to run their operations. “They are not militias, but illegal groups that contribute to fostering chaos and lack of security. They act on behalf of foreign nations,” Bashagha added.

If the political impasse continues, Haftar may come to be seen as a more attractive proposition to some western countries, which are now as interested in stability as in democracy.

Donald Trump last week described the removal of Muammar Gaddafi in 2011 as a catastrophe, saying the country would be better off if the former dictator were still in power.

But a western embrace of Haftar as the man to bring security back to Libya would have to overlook claims that the Libyan National Army, in the name of defeating terrorism, has committed acts worthy of referral to the international criminal court (ICC).

A legal opinion by the human rights lawyer Rodney Dixon QC said forces under the command of Haftar “appear to be involved in the commission of the war crimes of murder, mutilation, torture, cruel treatment, outrages upon personal dignity, and the targeting of civilians. These acts prima facie constitute crimes and violations of the Geneva convention.”

Dixon, an expert in international law and regarded as a critic of Saudi Arabia, was shown videos compiled in the past three to four months. He said that in his opinion, the violence in the videos served as “a stark reminder of the gruesome crimes being perpetrated with impunity in eastern Libya, and of the urgent need for decisive, corrective action”.

He added: “It is imperative that the perpetrators and their commanders should be investigated, to obtain all available evidence so that those responsible can be brought to justice. As a starting point, the individual perpetrators shown in the videos should be identified.

“Where there is evidence of them ordering these crimes, they should be prosecuted as direct offenders. Furthermore, those in charge should at least have known of these crimes, or had reason to know, and the failure to act to prevent or punish them could render those superiors criminally liable.”

The UN security council has made Libya subject to the jurisdiction of the ICC, which in August last year issued a warrant for the arrest of a commander in the Libyan National Army, Mahmoud al-Werfalli.

He was accused of ordering and participating in summary executions of prisoners in Benghazi, but remains at large. He had previously been arrested by Haftar; the ICC chief prosecutor, Fatou Bensouda, repeatedly called for Haftar to hand him over, but in July he was reported to have escaped prison.

The Libyan National Army said this week it was dropping the arrest warrant against him, prompting the ICC to repeat its call for his arrest.