The history of slavery in the Muslim world was throughout the history of Islam with slaves serving in various social and economic roles, from powerful emirs to harshly treated manual laborers. Slaves were widely in labour in irrigation, mining, and animal husbandry, but most commonly as soldiers, guards, domestic workers. The use of slaves for hard physical labor early on in Muslim history led to several destructive slave revolts, the most notable being the Zanj Rebellion of 869–883. Many rulers also used slaves in the military and administration to such an extent that slaves could seize power, as did the Mamluks.
Most slaves were imported from outside the Muslim world. Slavery in the Muslim world did not have a racial foundation in principle, although this was not always the case in practice. The Arab slave trade was most active in West Asia, North Africa (Trans-Saharan slave trade), and Southeast Africa (Red Sea slave trade and Indian Ocean slave trade), and rough estimates place the number of Africans enslaved in the twelve centuries prior to the 20th century at between six million to ten million. The Ottoman slave trade came from raids into eastern and central Europe and the Caucasus connected to the Crimean slave trade, while slave traders from the Barbary Coast raided the Mediterranean coasts of Europe and as far afield as the British Isles and Iceland.