IN MARCH 1995, the last United Nations troops packed their kit and fled from Somalia. It was not just the country that was left in ruins. Their departure was also a turning-point in the UN's post-cold-war role. The organisation's humiliating failure to pacify Somalia killed the hope, probably always unrealistic, that it could become the world's police force. The United States, which lost 18 of its soldiers in one bloody night in October 1993, was, from then on, opposed to almost any forcible UN intervention. It has not, since then, sent its troops to keep peace in Africa.

Later UN attempts to bring Somalia's clan-based factions together, and persuade them to share power, have all failed. The quarrelling warlords seemed indifferent to the starvation of thousands of their fellow-Somalis. But without the warlords' agreement, attempts to rebuild the country physically were a waste of time and money that have cost the UN millions of dollars.

Many believed that the Somalis, abandoned by the world, would end either by killing each other, or dying of starvation. They saw Somalia's collapse as anarchic and incomprehensible. The images of starving children, tanks firing at hospitals, and the body of a dead American soldier— a man who had gone “to save Somalia from itself”—being dragged through the streets of Mogadishu, made some wonder if self-destructive chaos like Somalia's might engulf the poor world. If such things could happen in Somalia, a nation that shared one religion, one ethnicity and one language, they could happen anywhere.

Have these fears been realised? Without a government for almost ten years and with little outside assistance, Somalis have not exterminated each other. In various ways, many have been doing quite well, a lot better than might have been expected and better than some Africans whose governments are under the tutelage of western donors, the World Bank and the International Monetary Fund.

The average Somali, self reliant and tough, is probably no worse off than the average Tanzanian or Zambian. Wages for unskilled workers in Hargeisa, the capital of Somaliland, in the north, which now considers itself independent of Somalia, are twice the rate in Nairobi, Kenya's capital city.

This year there is hunger in those Somali regions that have suffered drought for the past three years. No one knows how many people will be affected. The UN guesses about 1m. But, except for some sporadic fighting in the south, the hunger is caused by the weather, not by war or politics. In fact aid agencies and the UN may find it easier to get food to the needy in Somalia than they do in many bureaucratically run countries.

Galkayo, a desert town in central Somalia was once fiercely fought over. You might expect it to be a heap of rubble, hungry and anarchic. Far from it. On an evening stroll through its crowded streets, you find teashops and restaurants full, shops open, workshops brimming with bustle and noise. Houses are being built. You see no guns, no shattered buildings and, while people are clearly poor, no one is begging. Moreover, you can actually see. Galkayo has streetlights, the only town in Somalia to have them.

This is thanks to an entrepreneur, Abdirazak Osman, born here in 1960, who studied electrical engineering in the United States and set up a telephone contracting company with American partners. He returned to Somalia in 1997. “I feel more comfortable here and businesswise I do just as well if not better,” he explains. He persuaded his American partners to finance telephone companies in collaboration with Somali businessmen, first in Hargeisa, then in Mogadishu, Somalia's still violent capital (which he visited only once, he says with relief). However, his investment in Mogadishu is well protected by his Somali partners who can call up about 100 fighters. Last year he brought telephones to his home town, Galkayo.

As he was laying telephone cables, people asked Mr Osman if they were for electricity. No, he said, but the idea was born, and once Galcom, the telephone company, was running, he raised $400,000 from hisAmerican and Somali partners, bought two generators and started up an electricity company. He advertised by putting up street lights and providing free power to the hospital and other public buildings. Now, he says, he has more customers than he can cope with.

Mr Osman's telephone and electricity companies, a $1m investment so far, also play a political role in Galkayo. They are based in the northern part of the town, which is being brought under the control of the fledgling state of north-east Somalia called Puntland. The southern part of the town, inhabited by a different clan, is still in the hands of a clan militia. Mr Osman has set up a telephone sub-station in that part of town and is offering it electricity too, in the hope that this may prevent further fighting.

Mr Osman is typical of the entrepreneurs who have taken full advantage of the lack of government in the country to create nationwide businesses. “The collapse of Somalia has been good for business,” he says. “In many ways it is much better off than before. Then we had state monopolies and bureaucracy and corruption, and all the wealth was in Mogadishu. There has been no telephone system here since the late 1980s.”

All Somalia's towns now have a proliferation of telephone companies which charge about $1 a minute to anywhere outside Somalia; local calls are free. The companies consist of a satellite dish, a foreign carrier, and local offices with booths for callers. They pay a small licence fee and taxes to local administrations, but Mr Osman says he can make a healthy profit.

These telephone systems are at the heart of Somalia's survival and recovery. They have achieved more than millions of dollars of foreign aid could have done. They have enabled traders to make deals across the Gulf of Aden to Arabia, selling Somalia's livestock. The nomad with a mobile is imminent. And, say Somalis, business does not recognise clans. Lorries, laden with goods and with only token armed protection, move throughout Somalia and eastern Ethiopia. Fruit from the far south is sold in the far north-west, electrical goods landed at Berbera on the Gulf of Aden reach Mogadishu and even get smuggled into Kenya.

More important for ordinary Somalis, the telephones enable them to keep contact with exiles and expatriates. The commonest word you hear in the phone booths is lacag or money. The Somali family network is strong and members living abroad provide for those still at home.

Somalia's tight clan bonds have helped to set up worldwide banking networks. Someone in Ontario, for example, can give dollars to his local clan banker, and the equivalent will be collected by his family from the remittance bank in Galkayo within 24 hours. There are no receipts and no disputes. These remittances, hundreds of millions of dollars a year, keep Somalia going.

Somalia's politics are still messy and—in the south—violent, but there is a whiff of peace in the air. After the failed attempts to bring faction leaders together, meetings have been held at local level. The bottom-up approach has worked in several areas, thanks again to Somalia's exceedingly complex web of clan hierarchies and structures. Clans remain the bedrock of Somali political and social reality, both the cause of Somalia's break-up and the mechanism which has begun to put it back together again.

Through clan-based peace conferences the two northern chunks, Somaliland and Puntland, are reasonably peaceful and secure, though they dispute a large area. Puntland, in north-eastern Somalia, has set up a regional administration but, unlike Somaliland, is not claiming independence. Their local administrations try to institutionalise authority, collect taxes and get some development projects under way.

A similar process seems to be beginning in the south. The faction leaders there are losing their power. Ali Mahdi Muhammad, who once claimed the presidency, and ruled northern Mogadishu, has fled, driven out by his own people and unlikely to return. His rival, Hussein Aideed, son of the late Muhammad Aideed who chased the Americans out, is also losing territory and power. The elders of his Habr Gedir clan are turning against war, and businessmen are refusing to pay him “taxes”. The bad news is that Eritrea and Ethiopia are fighting a proxy war in Somalia, paying and arming opposing factions.

How should the rest of the world respond? On August 18th, Kofi Annan, the UN'ssecretary-general, called for the UN to increase its involvement in Somalia. The country will need food aid this year. It could also do with investment in roads, health clinics and schools. Beyond this, it needs the UN's help to protect its international rights, such as the right of its people to travel (at present they are literally stateless), and protection for its coasts from illegal fishing.

But the UN would be ill-advised to try to reconstitute Somalia as a centralised state. Instead, it should encourage its dismembered parts to form reasonably democratic administrations and secure nationwide agreement on common issues such as a central bank, roads, schools and health programmes. Can these be achieved without a central power? Maybe. But the six or seven entities that make up Somalia now should be left autonomous and the boundaries between them as flexible as possible. In time, with good fortune, they may come together in a loose confederation which would suit Somali social structure.