The United Nations officially declared an end Friday to the famine that struck parts of Somalia last year, but warned that the country still faced dire conditions, dpa reported. "Long-awaited rains, coupled with substantial agricultural inputs and the humanitarian response deployed in the last six months, are the main reasons for this improvement," the UN's Food and Agriculture Organization's (FAO) Director-General José Graziano da Silva told journalists in Nairobi after visiting southern Somalia. Nevertheless, the organization estimated that a drought - combined with ongoing conflict and food shortages - had claimed tens of thousands of lives. According to a report by the FAO and the United States Agency for International Development (USAID), the number of people in need of emergency humanitarian assistance had fallen from 4 million to 2.34 million, or 31 per cent of the Somali population. The FAO said 750,000 people had been at risk of death during the height of the crisis in 2011. A bumper harvest, helped by the distribution of seeds during a period of rains between October and December, helped reduce the scale of the emergency, which Graziano warned was "not over." "It can only be resolved with a combination of rains and continued, coordinated, long-term actions that build up the resilience of local populations and link relief with development," Graziano said. "We can't avoid droughts, but we can put measures in place to try to prevent them from becoming a famine," he added. The UN declared a famine in six out of eight regions of southern and central Somalia in July last year. Militant group al-Shabaab, which has been battling to oust the internationally-backed government since early 2007, was said to have worsened humanitarian conditions when it placed a ban on international relief groups. Somalis in areas worst-hit by the drought were often unable to access life-saving aid, forcing hundreds of thousands to flee their homes. Many crossed the border to refugee camps in neighbouring Kenya and Ethiopia.