TWO decades of war and terror have made Somalia one of the world's worst places to live. Last year at least 80,000 people died in a famine and 2.3m continue to need food assistance. Nobody imagines Somalia's fortunes might easily be turned around. Many Western governments have long kept their distance in despair. That includes America, which suffered a debacle there in 1993—later chronicled in the film “Black Hawk Down”.

Yet things are looking up. An initiative launched at an international conference in London on February 23rd could give Somalis new hope. Attended by Hillary Clinton, America's secretary of state, and senior representatives from 40 countries, it is the first push on this scale. The British, prime movers of the event, are pursuing a fresh diplomatic approach. Instead of trying to boost the “transitional federal government” in the capital, Mogadishu, the conference participants—foreign and Somali—say they will accept that the country is, for the time being, irretrievably broken into five or six zones of influence. Rather than put their faith in the feeble internationally recognised government, whose writ extends barely beyond Mogadishu, in the vain belief that it can bludgeon the rest of the country into submission, the leaders of the country's various fiefs have pledged to develop a more or less federal system.

The plan's timing is propitious, as the Shabab militia, which has for the past few years controlled the biggest swathe of Somalia, mainly in the country's south and centre, has recently lost ground and popularity. Ethiopian and Kenyan forces, with logistical backing from the Americans, French and British, have squeezed it in a pincer movement from the west and south. Moreover, the Shabab failed to feed the people in its zone of influence during last year's terrible drought. The Shabab's refusal to allow Western agencies such as Oxfam and the International Committee of the Red Cross into its territory is said to have alienated many of its former supporters. The Shabab shuffle At this stage the anti-Shabab forces at home and abroad, especially the Americans, have no intention of starting negotiations with the group, which has links to al-Qaeda, albeit tenuous ones—it was only on February 10th that Ayman al-Zawahiri, the deputy head of al-Qaeda, formally welcomed the Shabab as members of the terror franchise. Furthermore, America and the West have no immediate plans to bestow recognition on Somaliland, the de facto fully autonomous area in the north-west of the country that was ruled by Britain during the colonial era before Somalia's independence in 1964. Nowadays it is the best-run and safest part of Somalia.

But in due course Western feelers may indeed be put out to elements in the Shabab, much as with the Taliban in Afghanistan. Western intelligence agencies guess that the number of foreign jihadists operating with the Shabab is in the “low hundreds”, though no one is sure. It is unknown whether the supposed leader of the Shabab, the 34-year-old Moktar Ali Zubeyr, better known as Godane, or the powerful figure of Moktar Robow, who controls much of the south-central area, is remotely amenable to negotiation.

At present, Somalia faces a military stand-off. America operates a spy network there and recently launched a special-forces commando raid from its base in nearby Djibouti to free an American citizen from Somali brigands. It also operates drones from Ethiopia, providing intelligence to Kenyan and Ethiopian forces. They have gained ground against the Shabab since invading in mid-December, though the Kenyans have got bogged down on nigh-impassable roads. Their hope of capturing Kismayo, a Shabab stronghold, has yet to be realised.

The Ethiopians have done better, alongside a proxy force of Sufi Somalis known as the Ahlu Sunna Wal Jamaa (the Majority) or ASWJ, which now controls a wedge of land along the Ethiopian border. The Ethiopians took Baidoa, the second-biggest town held by the Shabab, on February 22nd. They hope to join up with the most northerly of the Kenyans' three prongs of attack.

The Shabab are just one of Somalia's scourges. Pirates have caused havoc among ships traversing vast parts of the Indian Ocean, as far east as the Seychelles and as far south as the Comoro islands. Pirates have not directly filled the Shabab's coffers, though they may occasionally have been forced to pay the jihadists a lucrative levy. In any event, the pirates' power may have peaked. The number of hijackings has declined dramatically, thanks to international maritime patrols and the arming of guards on ships. But worryingly for shippers, ransom demands may have risen as the number of captured ships falls. One recent demand was for a princely $11m.

On dry land, the official government of Somalia remains feeble in the extreme. “It doesn't even control Mogadishu,” says a Western aid worker with long experience of Somalia. “It doesn't administer anything. AMISOM [the African Mission to Somalia] does it all. [Somali] warlords control all the towns—and the aid.”

AMISOM, which has a joint mandate from the African Union and the UN, consists of some 10,000 troops, mainly Ugandans with some Burundians, soon to be increased to 17,000. The Ugandan acting foreign minister, Okello Oryem, said: “We're here for as long as it takes.”

The troops have gained ground in Mogadishu in the past few months, having cleared the Shabab out of the Bakara market, the capital's main trading hub. But they still face an average of five attacks a day by the Shabab, according to Western intelligence sources. Moreover, AMISOM has yet to counter-attack the Shabab deep in the countryside.

Rival anti-Shabab Somali administrations, based largely on clans, are entrenching themselves in their respective areas. Somaliland, where the Isak clan predominates under a more or less democratic mandate, has a strong lobby, especially in Britain, seeking to gain full independence. The Ethiopians trade with Somaliland and use its port of Berbera but hold back from endorsing full independence. Puntland, according to a Western diplomat, is “about 10-12 years behind Somaliland” but seeks to entrench the autonomy it has achieved within a federal Somalia. Its president, Muhammad Farole, has support from the diaspora in Australia.

Galmudug is another, smaller zone that has become a cohesive semi-independent fief, south of Puntland and north of the zone which the ASWJ more or less controls. Jubaland, in the far south, is sometimes envisaged as yet another semi-autonomous zone. Lastly, the pirates control a coastal strip that extends from Eyl in the north to Haradheere in the centre. Inland the towns of Galkayo and Garowe have benefited visibly from pirate wealth.

The plan to cantonise Somalia carries risks. The resulting country will still be corrupt and illiberal, though possibly less dysfunctional and deadly. The London plan is relatively crude—the tribal federations now being empowered are hardly ideal partners. The plan also depends on the success of foreign soldiers. Kenya's floundering force could become a recruiting sergeant for the Shabab if its occupation of Somalia's southern fringes becomes permanent or fails to benefit the locals.

Success furthermore depends on tribal federations working together in a constituent assembly that is yet to be set up. Lack of co-operation between regional power-brokers has long been a problem. At the same time, an eventual break-up of the country becomes more likely with cantonisation. Disputes over internal borders could eventually lead to bloodshed.

The Somali body politic is on life support. Neither domestic nor regional actors have much trust in each other, so the cantonisation plan is a long shot. But nothing else has worked since the last functioning state collapsed in 1991.

Correction: In the original version of this article, we said that the Shabab had prevented Médecins Sans Frontières from working in the areas that it controls. In fact, local staff are still providing medical services. Sorry. This has been corrected online.