Starving Somalis make the long journey on foot to refugee camps in Kenya, some of which have yet to officially open

Khadija Aliow Mohamed sits silently in the sand inside her tiny twig igloo, staring at the small bundle wrapped in a red and blue shawl on the bed. The 20-year-old Somali walked for 30 days with her two-year-old daughter Madina to get to this refugee camp in northern Kenya a few weeks ago.

Hungry and exhausted, the family escaped the worst drought in southern Somalia in decades, which has already claimed tens of thousands of lives, according to the United Nations. But while Mohamed regained her strength in Dadaab, the world's biggest refugee settlement, Madina did not. Just an hour after the UN declared a famine in two regions of Somalia, Madina died. Her mother, who is pregnant, is too shocked to talk.

Instead her grandfather, Ali Mohamed, explains what happened. Mohamed escaped Somalia with them, and carried Madina's body here along the sand road from the hospital at noon on Wednesday.

"The child never recovered from the malnutrition," he says, clutching a small blue slip of paper with the words "Permit for Burial".

"Madina died because of the drought."

She will not be the last. According to the UN, more than six out of every 10,000 people are dying of hunger every day in some parts of the Bakool and Lower Shabelle regions of Somalia, with more than half the children there suffering from acute malnutrition. This is far above the normal famine threshold of two deaths per 10,000 people a day, and 30% malnutrition levels, UN agencies say.

While there have been numerous disasters in the Horn of Africa over the past decade, it is the first time a famine has been declared in the region since 1992, when hundreds of thousands of Somalis starved to death, prompting an international peacekeeping intervention.

"Somalia is facing its worst food security crisis in the last 20 years," says Mark Bowden, the UN official in charge of humanitarian aid in Somalia. "This desperate situation requires urgent action to save lives."

Other countries in the region, in particular Ethiopia and Kenya, are also facing a crisis because of the failures of rains in pastoralist areas – the worst situation for 60 years in some places – as well as soaring food prices and longer term issues such as underdevelopment and high population growth. Across the Horn 11 million people require humanitarian assistance.

But it is Somalia, where the situation is even more complex, that has been hardest hit, with 3.7 million people, nearly half the population, requiring food aid. The country has lacked an effective government since before the famine of the early 1990s. Most of southern Somalia is controlled by the al-Shabab Islamist group, which has prevented most international aid organisations, including the World Food Programme, from operating in its areas two years ago, only lifting the ban last week.

This has meant that many people have received little or no help since the drought first started to bite last year. At the same time, prices of staple foods such as sorghum has increased more than threefold over a year, due to the conflict and lack of supply.

First the animals perished.

Ali Mohamed, the 63-year-old grandfather of the dead toddler Madina, says he lost his entire herd of 90 camels, goats and cows this year.

"There was no water, no grazing, no food production. We lost everything. This is the worst drought I've ever experienced."

Then people started to die of hunger-related diseases.

Over the past month the number of deaths has grown sharply, according to aid organisations, prompting an exodus from southern Somalia towards the capital Mogadishu, as well as across borders. Some 2,000 Somalis are crossing into Ethiopia a day, with a further 1,300 coming to Dadaab daily, according to Attidzah Fafa, head of the UNHCR office here. He says 30,000 people arrived in June alone, and he expects similar numbers in July and August.

The settlement, which was built for 90,000 people in Kenya's arid and barely hospitable northeast, now houses more than 370,000 Somalis. Instead of in the igloo-shaped huts covered in plastic sheeting, which many people sleep in, new arrivals like Idhoy Abdinor are forced to sleep under thorn trees. The 53-year-old grandmother finally reached Ifo, one of the Dadaab's three camps, on Tuesday. She had walked through the desert scrubland for 22 days wearing a pair of mismatched pink and yellow flipflops. She did not complain.

"Some of the others' shoes broke, so they had to come barefoot," she says.

With her came seven of her children, the youngest just eighteen months. After a night in the open on the outskirts of the camp, some other Somalis who arrived a few weeks ago shared some food rations with them.

Abdinor, who trekked from the town of Dinsor, says the situation there had became increasingly desperate.

"For the last three years we did not receive rain," says Abdinor, whose reed-thin forearms are cabled with protruding veins. "We were farmers, but there are no farms anymore. No animals."

War provided an extra push. Al-Shabab Islamist rebels and government forces had been clashing in the area recently. Abdinor's eighth child went missing during fighting three months ago, as did her husband. She has heard rumours that he is dead.

Still, the decision to leave was not easy, as Abdinor had heard the stories of how bandits are preying on the refugees on both sides of the border. Fortunately she was not robbed during the walk to Kenya, but she suffered greatly because of the lack of food and water.

"Some of us had donkey carts but the donkeys died because there was no water," she says. "We also had to leave some mothers and children behind on the road because they were too tired. People were very weak."

The next rains are only expected in September or Ocotober, and even if they are good, subsequent harvests are expected to be weak because so many people have been uprooted. The UN warned that without immediate action the famine would spread to all eight regions of southern Somalia within two months.

Oxfam, which is assisting new arrivals in Dadaab, says that of the $1bn (£619m) needed to avert a humanitarian disaster only $200m had been pledged, and accused several European governments, including France, Italy and Denmark of "wilful neglect" of a crisis that has been known about for many months.

"There is no time to waste if we are to avoid massive loss of life. We must not stand by and watch this tragedy unfold before our eyes," says Fran Equiza, Oxfam's regional director. "The world has been slow to recognise the severity of this crisis, but there is no longer any excuse for inaction."

But getting aid into Somalia is not going to be easy, despite al-Shabab agreeing to let humanitarian organisations in. The refugee agency UNHCR says it wants additional security guarantees from the rebels, who practise an extreme version of Islam, before stepping up assistance. The World Food Programme, which has experienced repeated problems in working with al-Shabab areas in the past, says it is ready to negotiate with local drought committees in rebel areas to ensure safety for its staff.

"Operations in Somalia are among the highest risk in the world, and WFP has lost 14 relief workers there since 2008," says the programme's executive director Josette Sheeran. "We will aggressively pursue efforts to mitigate against risk, through robust assessments and monitoring, but I am calling on all sides to stand together in recognising the inevitable risks that will be present in southern Somalia."

The agency said it was considering sending shipments of high-energy biscuits and other supplementary foods for children and pregnant mothers by air to strategic location in southern Somali where the needs are greatest.

Meanwhile in Dadaab, aid agencies are struggling to cope with the rapid influx of refugees. The Kenyan government, which is reluctant to host more Somalis on its soil, has yet to officially allow the opening of new camp for refugees that has already been built close by. So in the areas where there are fresh arrivals sleeping, people are also defecating in the open, raising fears of an outbreak of disease.

Still, no matter how grim the conditions here, there is also a palpable sense of relief from people that they have arrived somewhere where help is near. Asked why she had risked the 20-day walk to get here from Saku in Somalia, Garmana Mohamed Aden, a 30-year-old mother-of-two, replied instantly. "People were dying there."