FOUR years after the beginning of what is now called the Arab spring only in a tone of bitter irony, almost all the countries involved are in a dire state. The sole exception is tiny Tunisia. For a while, things seemed to be improving in its sprawling oil-rich neighbour, Libya, too. But Libya is slipping fast—and its chaotic decline, like that in Syria, is already drawing in outsiders and posing a threat to the West. Nowadays Libya is barely a country at all (see article). The factions that came together to fell Muammar Qaddafi have given up trying to settle their differences by negotiation. The east is under the control of a more or less secular alliance, based in Tobruk; in the west, a hotch-potch of groups in Tripoli and Misrata, once the symbol of heroic resistance to Qaddafi, hold sway, backed by hardline Islamist militias. Libya has two rival governments, two parliaments, two sets of competing claims to run the central bank and the national oil company, no functioning national police or army, and an array of militias that terrorise the country’s 6m citizens, plunder what remains of the country’s wealth, ruin what little is left of its infrastructure, and torture and kill wherever they are in the ascendancy.

Others are being dragged in. Turkey, Qatar and Sudan favour the Islamist-leaning factions, while Egypt and the United Arab Emirates (UAE), among others, back the more widely recognised eastern alliance. And the poison in Libya is seeping out across a great swathe of the Sahel, Africa’s scrublands south of the Sahara desert, from Mali in the west, through Niger and northern Nigeria, eastwards on to Sudan and Somalia, and even as far as Egypt’s Sinai desert abutting Israel. Arab tribes and other ethnic groups in the country’s rugged south are running amok, smuggling arms, trafficking people and providing havens and succour to assorted ne’er-do-wells and jihadists pledging allegiance to al-Qaeda and even to the murderous Islamic State in Iraq and Syria.

The West has tried to keep out of Libya. America, France and Britain reluctantly intervened to oust Qaddafi in order to prevent him massacring his fellow Libyans, but in the wake of Western failures in Iraq and Afghanistan, the trio was determined not to get sucked into overseeing Libya’s hoped-for transition to democracy, let alone put boots on the ground. Instead, it was left to the UN—and to the Libyans themselves, who insisted that they could mend the place on their own.

Qaddafi’s failure to build any institutional framework for the country made the task dauntingly hard for well-intentioned Libyans. The UN, mindful of the West’s toxicity in many Arabs’ eyes, was loth to ask Europe’s powers or America to step in. After the murder of America’s ambassador there, Barack Obama basically washed his hands of the place. The Europeans have hardly been hurrying to fill the gap.

Nearly hopeless, but not quite

This negligence is a mistake. Certainly, the West should not think of military intervention. But more energetic diplomacy has at least a chance of containing the conflict, and there is too much at stake not to try. Libya is only 300 miles from southern Europe. A bloodbath there would launch thousands more refugee ships across the Mediterranean. Jihadist hotspots, from Tora Bora to the fastnesses of Yemen and Somalia, have a habit of nurturing zealots whose targets include New York and Paris.

So the UN, the Arab League and leading Western governments all need to rejoin the diplomatic fray far more wholeheartedly. A new “friends of Libya” conference is needed, where the regional powers that have been using Libya as a proxy battlefield should be made to keep their previously dishonoured pledges to enforce an arms embargo. The only sensible course is to try to build a government of national unity, ideally backed by a new constitution that devolves autonomy to the regions and major cities (though it has to be admitted that such schemes have rarely worked in the winner-takes-all Arab world). Some of the oil money could be funnelled into a UN-supervised escrow account to be redistributed to public services on both sides of the battle lines. And if an agreement is negotiated, UN peacekeepers should be sent in.

In the end, it is for the Libyans to save Libya. Their task should be far easier than it is for, say, the Syrians, Iraqis or Yemenis, because Libya is a rich country with a small population that is fairly homogeneous in terms of religion, class and ethnicity. But they still need help. A chaotic Libya is too dangerous to the world to be left alone.