(CNN) -- Doctors Without Borders is pulling out of Somalia after more than two decades because of frequent attacks on its staff, the aid group said Wednesday.
The group, internationally known by its French name, Medecins Sans Frontieres, has worked in the nation since 1991.
It said civilian leaders tolerate or "condone the killing, assaulting and abducting " of aid workers.
"The same actors with whom MSF must negotiate minimum guarantees to respect its medical humanitarian mission have in some cases played a role in the abuses against MSF staff, either through direct involvement or tacit approval, particularly but not exclusively in south-central Somalia," it said.
In 2011, two MSF members were killed in Mogadishu, and their convicted killer was released early, the group said.
In addition, 14 other staff members have been killed and dozens of MSF's ambulances and medical facilities have been attacked, the group said.
"In choosing to kill, attack, and abduct humanitarian aid workers, these armed groups, and the civilian authorities who tolerate their actions, have sealed the fate of countless lives in Somalia," said Dr. Unni Karunakara, MSF's international president. "... The situation in the country has created an untenable imbalance between the risks and compromises our staff must make, and our ability to provide assistance to the Somali people."
The aid agency had a staff of about 1,500 in the nation to provide various services, including health care, malnutrition treatment, surgery and relief supplies.
Somalia has been plagued by a long-running struggle between government forces and Al-Shabaab, a militant Islamist group with connections to al Qaeda. It has waged a war to implement a stricter form of Islamic law in the country.
Two years ago, Somali and African forces pushed the militants out of the capital, Mogadishu, raising hopes of a return to relative security after about 20 years of violence.
But the militants have maintained control of large chunks of southern and central Somalia, where they stage attacks.
Until last year, Somalia had not had an effective government since dictator Mohamed Siad Barre was overthrown in 1991.