Famine conditions have ended in war-torn Somalia six months after being first declared, the UN has said.
The improvement in access to food is due to a good harvest and significant humanitarian assistance, it said.
But the UN humanitarian co-ordinator for the country said the situation remained serious.
Nearly a third of the population - some 2.34 million people - still need emergency support, the Somalia Food Security Nutrition Analysis Unit said.
Last month, the UN said that tens of thousands of people would have died of starvation by the time the food crisis ended.
Somalia has been worst hit by East Africa's worst drought in 60 years, because of its instability.
Many Somalis fled rural areas controlled by the Islamist al-Shabab group as it has banned most Western aid agencies from operating in its territory.
On Monday, the al-Qaeda-linked militants expelled the International Committee of the Red Cross, one the few international groups still delivering food aid to areas under their control.
The UN declared a famine in two parts of southern Somalia last July and, in September, extended the warning to four more regions of the country.
"The gains are fragile and will be reversed without continued support," said Mark Bowden, the UN's humanitarian co-ordinator for Somalia.
He said in southern Somalia alone, some 1.7 million remained "in crisis".
"Millions of people still need food, clean water, shelter and other assistance to survive and the situation is expected to deteriorate in May," he said.
Some of tens of thousands of people who fled to Mogadishu in search of food during the famine are hoping to return home.
"We are going back to our farms as it has been raining recently in our area," one man from the Bay region, which is in al-Shabab territory and was downgraded from a famine zone in November, told the BBC.
"We have been helped by aid workers and we are quite happy to return to our respective areas," he said.
A woman from Burhakaba in Bay region who is also leaving Mogadishu said: "We thank the charity organisation which is helping us to return home."
The UN said that the latest harvest in Somalia was double that of the average over the past 17 years, lowering food prices, though mortality rates in southern Somalia were still among the highest in the world.
The situation is particularly precarious for an estimated 325,000 children who are acutely malnourished, the UN said.
Although $1.3bn (£84mn) worth of aid has been poured into the country, the scale of the suffering remains immense, says the BBC Africa analyst Martin Plaut.
"The crisis is not over. It can only be resolved with a combination of rains and continued, co-ordinated, long-term actions that build up the resilience of local populations and link relief with development," Jose Graziano da Silva, the new head of the UN's Food and Agricultural Organisation, said in Nairobi.
Last year, tens of thousands of Somalis fled rural areas - many over the borders to Ethiopia and Kenya - in search of food. The UN estimates that a total of 1.5 million people have been displaced by the crisis.
Vulnerable areas remain in the southern and central areas of Somalia under the control of al-Shabab.
In recent weeks, al-Shabab has lost ground to both Kenyan and Ethiopian forces, which have moved onto Somali territory.
Somalia has not had a functioning central government for more than 20 years and has been racked by fighting between militias.