NAIROBI, Kenya -- One of the world's most tenacious humanitarian groups said Wednesday that it could no longer endure the risks that come with operating in Somalia, in a move that underscored the continued violence in the country despite recent steps toward stability.
After suffering years of attacks on its staff members in Somalia, the international medical charity Doctors Without Borders said that it would shut down all operations in the country after 22 years of working there.
"The closure of our activities is a direct result of extreme attacks on our staff," said the group's international president, Unni Karunakara, "in an environment where armed groups and civilian leaders increasingly support, tolerate or condone the killing, assaulting, and abducting of humanitarian aid workers."
The move will strip many civilians of access to health care. Last year in Somalia, the group provided outpatient treatment to 624,200 people, admitted an additional 41,100 to hospitals and performed 2,750 surgeries. An employee at the Daynile hospital in the capital, Mogadishu, said the group's pullout would be "disastrous," though he added that Doctors Without Borders had pledged to continue supporting the facility for three months.
The news of the pullout adds to the growing number of setbacks that have undercut the Somali government's narrative of a country on the upswing. A recent series of devastating attacks by the Shabab militant group, including a deadly assault on a United Nations compound, had already put those widely touted security gains into question.
The Somali government will discuss the departure of Doctors Without Borders in a cabinet meeting on Thursday, a spokesman said, but declined to comment otherwise.
Dr. Karunakara said that his group's 1,500 Somali staff members already had been informed of the decision. He said the group had no expatriate workers left in the country.
The group had endured dozens of attacks on staff members, vehicles and facilities over the years. A total of 16 staff members have been killed in Somalia since 1991. Two Doctors Without Borders staff members were killed in Mogadishu in December 2011. Their killer was subsequently granted an early release, according to the group.
Two other aid workers for the group were kidnapped after Somali militants entered the Dadaab refugee camp in Kenya in October 2011. The two women were held hostage for 21 months before they were freed last month. Dr. Karunakara declined to comment on either the abduction or the release.
Founded in Paris in 1971 as Médecins Sans Frontières and often referred to by the French initials M.S.F., the group prides itself on being "neutral, independent and impartial." Staff members deliver medical treatment to people affected by wars and natural disasters, to communities ravaged by epidemics and those that otherwise simply would not have access to medical services.
Its workers have a reputation for being among the bravest in the field, often the first ones in when disaster strikes and the last to leave. In 1999, Doctors Without Borders was awarded the Nobel Peace Prize.
The group operates in some of the most dangerous places in the world, including Syria and Afghanistan. But the inherent and seemingly growing dangers of its work have become clear through a series of recent episodes.
In South Sudan this month, a group of armed men attacked a vehicle belonging to the group on the outskirts of the capital, Juba. Two staff members were wounded, one of them, identified only as Joseph, 28, died two days later. Doctors Without Borders requested an investigation into what the group's director of operations, Marcel Langenbach, called a "brutal attack."
Last week, the group announced that it would suspend activities in and around the town of Pinga in the Democratic Republic of Congo after its staff members there were threatened.
Dr. Karunakara said he had gone early in the morning to Somalia's embassy in Nairobi, Kenya, to break the news. He seemed visibly disappointed to have to make the withdrawal, calling it "undoubtedly the most difficult announcement I have had to make."
Somalia plunged into chaos in 1991 after warlords brought down the central government. That same year, Doctors Without Borders began operating there. The group stayed even after American troops and United Nations peacekeepers left. The country has suffered through warring militias, pirates and Islamist militants, as well as devastating drought and famine.
The shutdown in Somalia will also affect the semiautonomous regions of Somaliland and Puntland, which are generally viewed as safer than other parts of the country. Western intelligence officials have said that Shabab fighters pushed out of other areas of Somalia by African Union forces have moved north. The British government earlier this year warned of threats to kidnap foreigners in Hargeisa, the capital of Somaliland.
African Union peacekeepers managed to push the Shabab out of Mogadishu, and members of the diaspora have returned, leading to a property boom in the capital and an array of new businesses popping up.
When asked about the recent security gains, Dr. Karunakara said, "We do not share that optimism."
This year, bombings have rocked popular restaurants and the court complex. In June, 15 people were killed in the attack by Shabab militants on a United Nations compound in Mogadishu.
"We have reached our limit," Dr. Karunakara said. He added, "Unfortunately the Somali people will pay the highest cost."
Mohammed Ibrahim contributed reporting from Mogadishu, Somalia.
This article originally appeared in The New York Times.