Medical charity Medecins Sans Frontieres (MSF) is closing all its programmes in Somalia after 22 years working in the war-torn country.
It said in a statement that the decision had been taken because of "extreme attacks on its staff".
It said armed groups and civilian leaders increasingly "support, tolerate or condone the killing, assaulting, and abducting of humanitarian aid workers".
More than 1,500 staff have provided a range of services across Somalia.
Unni Karunakara, MSF's international president, said it has been one of the hardest decisions MSF has ever had to make.
Since 1991, when Somalia descended into civil war, 16 MSF workers have been killed and there had been dozens of attacks on its staff, ambulances and medical facilities, the charity said.
Last month, two of its Spanish members of staff who were kidnapped nearly two years ago and held in Somalia were freed.
"Ultimately, civilians in Somalia will pay the highest cost," Dr Karunakara said in a statement.
"Much of the Somali population has never known the country without war or famine.
"Already receiving far less assistance than is needed, the armed groups' targeting of humanitarian aid, and civilians leaders' tolerance of these abuses, has effectively taken away what little access to medical care is available to the Somali people."
Somali news leader