It is now nearly five years since the revolution broke out in Libya and four since Muammar Gaddafi was toppled. Military intervention had unintended consequences. It produced another insurgency in Mali by ousting the Tuareg. It poured arms into the country and left a patchwork of city states which has shattered any sense of national unity. Every regional power has since been vying for control.

Libya has become a stage for proxy conflicts in which the needs and interests of Libyans are secondary to the great colonial games being played by rival Gulf states. Anywhere between one and two million Libyans have fled out of a population of six million.

Along the way, the credibility of the international community as an honest broker has been shredded. The €61bn Marshall Fund promised at the G8 meeting in 2011 never materialised. Early elections failed to produce a government of national unity and no, Westminster could not be parachuted in to Tripoli.

The international community played politics. It cherry picked its partners and its causes. It ignored a Supreme Court ruling that the House of Representatives (HoR) in Tobruk was unconstitutional, but listened to it when the same court ruled that Ahmed Maitiq could not be prime minister.

There has been complete silence - no reaction at all, let alone an official investigation - to leaked emails showing that Bernardino Leon was secretly advancing the interests of his future employers the UAE while working as UN special envoy. A letter of complaint from one of the parliaments, the General National Congress, was ignored. The news was buried on the day of the Paris attacks.

A rival peace initiative in Tunis was also ignored. But “Leongate” did not stop the plan the former envoy was working on. It was pushed ahead regardless. On Sunday in Rome representatives of 17 countries, including Egypt, Germany, Russia, Turkey and China signed a joint statement calling for an immediate ceasefire and promising to cut off contacts with factions that do not sign the deal.

After only three days the UN plans for a signing ceremony in Skirhat, Morocco, on Wednesday seem in turmoil. Based on the signatures of individual members of the two rival parliaments in Tobruk and Tripoli, the UN appears to have gone over the heads of both bodies.

The anger was such that it forced the rival leaders of the two institutions, the Western-backed HOR in Tobruk and the Tripoli-based GNC to meet each other for the first time in Malta. They jointly rejected the UN push to sign the deal.

“We came here to announce to the world that we are able to solve our problems ourselves with the help of the international community, but we will not accept foreign intervention against the will of the Libyan people,” said GNC President Nouri Abusahmain.

These are not the only concerns with the UN plan. Instead of creating one parliament out of two, it could, according to analysts like Mattia Toaldo, fellow of European Council on Foreign Relations, create three parliaments out of two. No thought had been given to the security guarantees needed from all militias before a government of national unity can sit and meet in Tripoli.

The suspicion is that announcing a deal has become more important than delivering one. Why and why now?

Leon was quite specific in his email to the UAE Foreign Minister Abdullah bin Zayed about his strategy. Leon said the primary object of his plan was to “break a very dangerous alliance between radical Islamists/MB (Muslim Brotherhood) and Misratans”. However you style them, this is one party of the conflict located in Tripoli. NATO was happy to fight alongside these militias when they were ousting Gaddafi.

Leon did not want an agreement that gave all sides of the conflict an equal stake in the political future of the conflict. About this too, he was brutally clear: “I have an strategy, which I am pretty sure should work, to completely delegitimise GNC (General National Congress)," Leon wrote.

The former Spanish diplomat was concerned at the prospect of the EU and the US seeking a comprehensive settlement: "Some international actors (mainly US and EU) have been asking in the last days to go to the ‘Plan B’ i.e. a classical peace conference with the fighting actors, against the backdrop of a UN multinational force. This is, in my opinion, a worse option than a political dialogue: first of all, as you have very rightly pointed out, because it will treat both sides as equal actors and will bypass legitimate institutions. Also, because it will sit around the table, to discuss an overall solution that will include political elements, the militias, and this might include some radical ones or their allies.“

Treating both sides as equal actors? Heaven forbid: “The country we mentioned in our last conversation [the United Arab Emirates] won’t be willing to support such a possibility,” Leon wrote. That is what matters in his eyes, not the US or the EU, or indeed the UN. And there lies the problem. Not that the UN itself has been without its problems. Another leaked email, a UAE diplomat at the UN was concerned about how to provide cover for the fact that his government was shipping weapons to Libya in violation of the UN arms embargo.

"The fact of the matter is that the UAE violated the UN Security Council Resolution on Libya and continues to do so," Ahmed al-Qasimi, a senior Emirati diplomat, wrote in a 4 August email to Lana Nusseibeh, the UAE's ambassador to the UN.

If the diplomats had complied with the procedures outlined by the UN resolution, Qasimi wrote, it would "expose how deeply we are involved in Libya ... We should try to provide a cover to lessen the damage."

Leon himself said a year ago in his email that the presence of Islamic State or al-Qaeda affiliated groups in Libya was a secondary consideration to the need to break the alliance of Islamist factions with the city state of Misrata.

Had IS grown so powerful in a year in Libya that it has overturned all calculations? Apparently not. Libya experts lined up at the Mediterranean Dialogues conference in Rome, organised by the Italian Ministry of Foreign Affairs and the Italian Institute for International Political Studies, to urge caution.

Alison Pargeter, North Africa analyst, and senior research fellow at the Royal United Services Institute was one of them. She told the conference: “All the talk of Libya being a fall-back position for IS and streams of Iraqis and Syrians flowing into Libya is at this point overstated. ISIS is present but its only really strong in certain areas, like Sirte and its surroundings.” Three factors, according to Pargeter, circumscribe their expansion: the role of the tribes, the presence of other armed groups and the inherent Libyan suspicion of outsiders.

She warned the international community about conflating IS with rival jihadi Libyan groups who did at one point fight them: the Benghazi Revolutionary Shura Council, the Derna Mujaheddin Shura Council, the Ajdabiya Revolutionary Shura Council have all issued statements distancing themselves from ISIS.

She said: "We really can’t dismiss all these jihadists and lump them together as Isis, as a problem that can simply be eliminated. Perhaps we have to accept that some of these elements cannot be beaten militarily and like it or not, they are going to have to be part of the solution for Libya, and they are an uncomfortable part of the jigsaw puzzle that needs to be dealt with if Libya is ever to achieve peace.”

But this is not what Britain and France are saying. A British government source told The Telegraph that ministers were "moving in the direction" of a plan to send military support alongside European allies to defeat IS in Libya. France, which sent reconnaissance flights over Libya, is pushing too for another Western bombing mission. French premier Manuel Valls on Friday called for international efforts to crush the Islamic State jihadists to extend to the north African country. "We are at war, we have an enemy, that we must fight and crush in Syria, in Iraq and soon in Libya too," he said.

Such an outcome is what Egypt and the UAE have been pushing for ever since the military coup in Cairo two years ago. Almost the first act of the new regime in Egypt in 2013 was to warn that a foreign intervention in the east of Libya was needed. Abdel Fattah al-Sisi’s annointed general for the job is the renegade ex-CIA Libya general Khalifa Haftar - a figure so divisive he has even managed to split the parliament in Tobruk.

Before bombing can start, Britain and France need to be invited to intervene by Libya itself. That cannot happen unless there is a nominal government of national unity. It does not have to meet. It simply has to exist as a virtual entity. Here then lies the answer to the rush to create a national unity government. Its first act would not be to start a process of national reconciliation. Nor indeed embark on the quest for national security. It would be to rubber stamp another foreign intervention.

Interventions form a perfect circle - from Libya to Mali to Iraq, to Syria and now back to Libya. Each intervention provides the pretext for another. And none of them end. France launched its military intervention in Mali in January 2013 to stop an uprising of different militant groups in the north. The mission was to free the north from jihadist occupation and restore Malian sovereignty on the whole territory. Little of the sort has happened. Operation Serval has finished and Operation Barkhane has continued. The French are still there, as are the jihadists.

Bombing IS in Sirte would almost certainly mean bombing other jihadist groups in the east of the country, who until today have largely acted as a brake on IS’s expansion. After nearly five years, Libyans should wake up to the fact that neither the UN nor the international community can bring the conflict in Libya to an end. Experience has shown that international mediation can be corrupted. It can therefore deepen and prolong the conflict.

- David Hearst is editor-in-chief of Middle East Eye. He was chief foreign leader writer of The Guardian, former Associate Foreign Editor, European Editor, Moscow Bureau Chief, European Correspondent, and Ireland Correspondent. He joined The Guardian from The Scotsman, where he was education correspondent.

The views expressed in this article belong to the author and do not necessarily reflect the editorial policy of Middle East Eye.

Photo: General Khalifa Haftar (R), commander of the armed forces loyal of the Tobruk-based Libyan government, shakes hands with UN envoy Martin Kobler, the head of the UN Support Mission in Libya, in the eastern town of al-Marj, on 16 December, 2015 (AFP/HO/ LIBYAN ARMED FORCES MEDIA OFFICE).