Eunuchs, castrated male slaves, were employed at the courts of kingdoms and empires throughout Africa north of the equator. While the practice may have started as early as the 6th century bce, it became widespread during the medieval and early modern eras. Eunuchs were part of palace culture in both East and West Africa and in both Muslim and animist polities. Ethiopia was a notable exception to this rule; there, uncastrated male servants held posts that in other polities were filled by eunuchs. The transportation and castration of African eunuchs formed part of a much larger trade in African slaves along overland caravan routes and through the Red Sea. A shifting collection of castration centers existed across supraequatorial Africa. In East Africa, Upper Egypt was a key center; in Central and West Africa, Bagirmi became a center in the 18th century. Court eunuchs performed an array of roles, notably those of gatekeepers and companions to the ruler, harem guardians, and supervisors of the palace treasury. Particularly in West Africa, they also took on military duties. African eunuchs were also widely employed at imperial courts outside Africa, particularly in the Near East and South Asia. Beginning in the 12th century ce, a corps of mostly African eunuchs also guarded the Prophet Muhammad’s tomb in Medina and the Kaʿba in Mecca. Sporadic attempts to abolish the trade in eunuchs and their employment were unsuccessful before the British-led abolition movement of the 19th century. Even so, African eunuchs continued to serve in several West African kingdoms and in the Ottoman Empire until the early 20th century.