It is time to finally accept what an abject failure the United Nations and the European Union have presided over in their misguided attempts to solve the disastrous situation in Libya. They have failed even to protect the spillover into the EU itself.

The flotilla of vessels stationed in the Mediterranean with a humanitarian mandate to rescue migrant boats has worsened an already critical migrant problem, encouraging more people to make the dangerous crossing and probably enabling more terrorist sleeper cells to reach European shores.

On the ground in Libya, the problem of how to reconcile feuding militias, tribes and towns has proved intractable for the UN. As has erasing extremist elements, including those who believe in Daesh, who continue to see Libya as the Mediterranean base of their so-called Caliphate.

Almost no UN agreement has been accepted by all parties in Libya, and the international community – with its increasingly evident ignorance of the country – is clearly running out of ideas for ending the turmoil in Libya.

For example, the West’s imposition of an unelected UN-appointed Government of National Accord bestowed with international recognition has proven to be a massive problem in Libya. Intentional or not, such divisive action by the international community has only fuelled divisions and polarisation in the country.

Equally, the West’s ongoing support of the Muslim Brotherhood in Libya has enabled extremism under a variety of guises to thrive, further driving the country to the brink of partition.

When the guns eventually fall silent in Libya, the international community should grab the opportunity to promote peace and stability

The West has clung to the same failing strategies and policies for the last five years, and both the Libyans themselves and the international community are now facing the prospect of the country’s division into Cyrenaica in the east and Tripolitania in the west, at the very least: a ‘Balkanisation’ of Libya, as happened in the former Yugoslavia.

When the guns eventually fall silent in Libya, the international community should grab the opportunity to promote peace and stability in the country with a new approach: creating a truth and reconciliation commission along the lines of that created in South Africa when power was transferred to the African National Congress.

For those who see themselves as victims, this will have the merit of allowing a cathartic account of their experiences to emerge.

Although such a commission could be criticised for allowing amnesty to controversial figures from the former regime, it is starting to look like the only ray of hope for a stable Libya in the future.

As the British learned during the peace process that ended the troubles in Northern Ireland, bringing a temporary sudden end to violence means swallowing some bitter pills and even negotiating with so-called terrorist elements. Time will tell if that Powell-Blair strategy brings about a long-term solution in Ireland, let alone in other hotspots. I personally doubt it.

A truth and reconciliation commission would, of course, be adapted to the needs and conditions of Libya. Its choice of members – whether exclusively Libyan or a combination of Libyan and international judges, lawyers and human activists – would be critical for its success.

An unnamed senior source at the UN suggested privately last week that even Ayesha Gaddafi, the daughter of the late leader, could be part of such a commission. She is highly educated, more so than her seven brothers were, a practising lawyer and has actually worked at the UN.

While some might balk at the thought of a member of the Gaddafi family holding such a role, the truth is that a truth and reconciliation commission could only work if all parties were represented. Interestingly, the largest tribe, the Werfalla, swore early this year their loyalty to Ayesha.

Richard Galustian is a security analyst.