|Part of a series on|
Slavery in Somalia existed as a part of the East African slave trade. To meet the demand for menial labor, Bantus from southeastern Africa slaves were exported from the Zanzibar and were sold in cumulatively large numbers over the centuries to customers in Somalia and other areas in Northeast Africa and Asia. People captured locally during wars and raids were also sometimes enslaved by Somalis mostly of Oromo and Nilotic origin. However, the perception, capture, treatment and duties of both groups of slaves differed markedly, with Oromo favored. 
Between 2500–3000 years ago, speakers of the original proto-Bantu language group began a millennia-long series of migrations eastward from their original homeland in the general Cameroon area of Central Africa. This Bantu expansion first introduced Bantu peoples to southern and southeastern Africa.
The Bantus inhabiting Somalia are descended from Bantu groups that had settled in Southeast Africa after the initial expansion from Cameroon, and whose members were later captured and sold into the East African slave trade.
Bantus are ethnically, physically, and culturally distinct from Somalis, and they have remained marginalized ever since their arrival in Somalia.
All in all, the number of Bantu inhabitants in Somalia before the civil war is thought to have been about 80,000 (1970 estimate), with most concentrated between the Juba and Shabelle rivers in the south. Recent estimates, however, place the figure as high as 900,000 persons.
Main article: East African slave trade
The Indian Ocean slave trade was multi-directional and changed over time. To meet the demand for menial labor, Bantu slaves were captured by Somali slave traders from southeastern Africa were sold in cumulatively large numbers over the centuries to customers in Egypt, Arabia, the Persian Gulf, India, the Far East, the Indian Ocean islands, Ethiopia and Somalia.
From 1800 to 1890, between 25,000 and 50,000 Bantu slaves are thought to have been sold from the slave market of Zanzibar alone to the Somali coast. Most of the slaves were from the Majindo, Makua, Nyasa, Yao, Zalama, Zaramo and Zigua ethnic groups of Tanzania, Mozambique and Malawi. Collectively, these Bantu groups are known as Mushunguli, which is a term taken from Mzigula, the Zigua tribe's word for "people" (the word holds multiple implied meanings including "worker", "foreigner", and "slave").
Bantu and Oromo adult and children slaves.  and were purchased in the slave market exclusively to do undesirable work on plantation with oversight from the Arabian peninsula. They were made to work in plantations owned by Somali and Arab merchants along the southern Shebelle and Jubba rivers, harvesting lucrative cash crops such as grain and cotton. Bantu slaves toiled under the control of and separately from their Somali patrons.
In terms of legal considerations, Bantu slaves were devalued. Somali social mores strongly discouraged, censured and looked down upon any kind of sexual contact with Bantu slaves. Freedom for these plantation slaves was also often acquired through escape.
As part of a broader practice then common among slave owners in Northeast Africa, some Somali masters in the hinterland near Mogadishu reportedly used to circumcise their female slaves so as to increase the latter's perceived value in the slave market. In 1609, the Portuguese missionary João dos Santos reported that one such group had a "custome to sew up their females, especially their slaves being young to make them unable for conception, which makes these slaves sell dearer, both for their chastitie, and for better confidence which their masters put in them."
In the 1940s, the first fugitive slaves from the Shebelle valley began to settle in the Jubba valley.
The Italian colonial administration abolished slavery in Somalia at the turn of the 20th century. Some Bantu groups, however, remained enslaved well until the 1930s, and continued to be despised and discriminated against by large parts of Somali society.
The Bantus were also conscripted to forced labor on Italian-owned plantations since the Somalis themselves were averse to what they deemed menial labor, and because the Italians viewed the Somalis as racially superior to the Bantu.
While upholding the perception of Somalis as distinct from and superior to the European construct of "black Africans", both British and Italian colonial administrators placed the Jubba valley population in the latter category. Colonial discourse described the Jubba valley as occupied by a distinct group of inferior races, collectively identified as the WaGosha by the British and the WaGoscia by the Italians. Colonial authorities administratively distinguished the Gosha as an inferior social category, delineating a separate Gosha political district called Goshaland, and proposing a "native reserve" for the Gosha.
In the late 19th century, Somalis also captured other peoples from the coastal regions of Kenya to work for them as slaves and clients. Referred to as the Kore, these Nilo-Saharan Maa-speaking Nilotes were later emancipated by British colonial troops. They subsequently resettled on the Lamu seaboard as fishermen and cultivators. Like many Bantus, the Kore reportedly now speak the Afro-Asiatic Somali language on account of their time in servitude.
In addition to Bantu plantation slaves, Somalis sometimes enslaved peoples of Oromo pastoral background that were captured during wars and raids on Oromo settlements. However, there were marked differences in terms of the perception, capture, treatment and duties of the Oromo pastoral slaves versus the Bantu plantation slaves.
On an individual basis, Oromo subjects were not viewed as racially jareer by their Somali captors. The Oromo captives also mostly consisted of young children and women, both of whom were taken into the families of their abductors; men were usually killed during the raids. Oromo boys and girls were adopted by their Somali patrons as their own children. Prized for their beauty and viewed as legitimate sexual partners, many Oromo women became either wives or concubines of their Somali captors, while others became domestic servants. In some cases, entire Oromo clans were assimilated on a client basis into the Somali clan system.
Neither captured Oromo children nor women were ever required to do plantation work, and they typically worked side-by-side with the Somali pastoralists. After an Oromo concubine gave birth to her Somali patron's child, she and the child were emancipated and the Oromo concubine acquired equal status to her abductor's other Somali wives. According to the Somali Studies pioneer Enrico Cerulli, in terms of diya (blood money) payments in the Somali customary law (Xeer), the life of an Oromo slave was also equal in value to that of an ordinary ethnic Somali.
Freedom for Oromo slaves was obtained through manumission and was typically accompanied by presents such as a spouse and livestock. During abolition, former Oromo slaves, who generally maintained intimate relations with the Somali pastoralists, were also spared the harsh treatment reserved for the Bantu and Nilotic plantation slaves.