Various Islamic groups or thinkers have espoused views on slavery which have been radically different throughout history.Lewis 1994, Ch.1 Slavery was a mainstay of life in pre-Islamic Arabia and surrounding lands.Brockopp, Jonathan E., "Slaves and Slavery", in: Encyclopaedia of the Qurʾān, General Editor: Jane Dammen McAuliffe, Georgetown University, Washington DC. The Quran and the hadith (sayings of Muhammad) address slavery extensively, assuming its existence as part of society but viewing it as an exceptional condition and restricting its scope. Islamic sources indicate that Muhammad acquired slaves through purchases, gifts, and war spoils. Although many hadiths encourage kindness toward the enslaved, critics argue that his direct ownership and involvement in the slave trade validate the institution within Islam.

Early Islam forbade enslavement of dhimmis, the free members of Islamic society, including non-Muslims and set out to regulate and improve the conditions of human bondage. Islamic law regarded as legal slaves only those non-Muslims who were imprisoned or bought beyond the borders of Islamic rule, or the sons and daughters of slaves already in captivity. In later classical Islamic law, the topic of slavery is covered at great length.

Slavery in Islamic law is not based on race or ethnicity. Caucasians and Central Asians formed the majority of imported slaves until the 10th to 13th centuries, when they were surpassed by the number of black African slaves. However, while there was no legal distinction between white European and black African slaves, in some Muslim societies they were employed in different roles. Slaves in Islam were mostly assigned to the service sector, including as concubines, cooks, and porters. There were also those who were trained militarily, converted to Islam, and manumitted to serve as soldiers; this was the case with the Mamluks, who later managed to seize power by overthrowing their Muslim masters, the Ayyubids. In some cases, the harsh treatment of slaves also led to notable uprisings, such as the Zanj Rebellion.

The Arab slave trade typically dealt in the sale of castrated male slaves. Black boys at the age of eight to twelve had their penises and scrota completely amputated. Reportedly, about two out of three boys died, but those who survived drew high prices. However, according to Islamic law and Muslim jurists, castration of slaves was deemed unlawful; this view is also mentioned in the Hadith. Bernard Lewis opines that in later times, the domestic slaves, although subjected to appalling privations from the time of their capture until their final destination, seemed to be treated reasonably well once they were placed in a family and to some extent accepted as members of the household.

The Muslim slave trade was most active in West Asia, Eastern Europe, and Sub-Saharan Africa. After the Trans-Atlantic slave trade had been suppressed, the ancient Trans-Saharan slave trade, the Indian Ocean slave trade and the Red Sea slave trade continued to traffic slaves from the African continent to the Middle East. Estimates vary widely, with some suggesting up to 17 million slaves to the coast of the Indian Ocean, the Middle East, and North Africa. Abolitionist movements began to grow during the 19th century, prompted by both Muslim reformers and diplomatic pressure from Britain. The first Muslim country to prohibit slavery was Tunisia, in 1846. During the 19th and early 20th centuries all large Muslim countries, whether independent or under colonial rule, banned the slave trade and/or slavery. The Dutch East Indies abolished slavery in 1860 but effectively ended in 1910, while British India abolished slavery in 1862. The Ottoman Empire banned the African slave trade in 1857 and the Circassian slave trade in 1908, while Egypt abolished slavery in 1895, Afghanistan in 1921 and Persia in 1929. In some Muslim countries in the Arabian peninsula and Africa, slavery was abolished in the second half of the 20th century: 1962 in Saudi Arabia and Yemen, Oman in 1970, Mauritania in 1981.Martin A. Klein (2002), Historical Dictionary of Slavery and Abolition p. xxii, However, slavery has been documented in recent years, despite its illegality, in Muslim-majority countries in Africa including Chad, Mauritania, Niger, Mali, and Sudan. See later in article.

In modern times, various Muslim organizations reject the permissibility of slavery and it has since been abolished by all Muslim majority countries. Many modern Muslims see slavery as contrary to Islamic principles of justice and equality. However, Islam had its own system of slavery that involved many intricate rules on how to handle slaves.Ali 2006, pp. 53–54, "...the practical limitations of the Prophet’s mission meant that acquiescence to slave ownership was necessary, though distasteful, but meant to be temporary." There are Islamic extremist groups and terrorist organizations who have revived the practice of slavery while they were active.

Slavery in pre-Islamic Arabia Slavery was widely practiced in Arabia before Muhammad's declaration of prophethood or pre-Islamic Arabia, as well as in the rest of the ancient and early medieval world. The minority were white slaves of foreign extraction, likely brought in by Arab caravaners (or the product of Bedouin captures) stretching back to biblical times. Native Arab slaves had also existed, a prime example being Zayd ibn Harithah, later to become Muhammad's adopted son. Arab slaves, however, usually obtained as captives, were generally ransomed off amongst nomad tribes.Brunschvig. 'Abd; Encyclopedia of Islam The slave population increased by the custom of child abandonment (see also infanticide), and by the kidnapping, or, occasionally, the sale of small children.Lewis (1992) p. 4 There is no conclusive evidence of the existence of enslavement for debt or the sale of children by their families; the late and rare accounts of such occurrences show them to be abnormal, Brunschvig states (According to Brockopp, debt slavery was persistent.) Free persons could sell their offspring, or even themselves, into slavery. Enslavement was also possible as a consequence of committing certain offenses against the law, as in the Roman Empire.

Two classes of slave existed: a purchased slave, and a slave born in the master's home. Over the latter the master had complete rights of ownership, though these slaves were unlikely to be sold or disposed of by the master. Female slaves were at times forced into prostitution for the benefit of their masters, in accordance with Near Eastern customs.

The historical accounts of the early years of Islam report that "slaves of non-Muslim masters ... suffered brutal punishments. Sumayyah bint Khayyat is famous as the first martyr of Islam, having been killed with a spear by Abū Jahl when she refused to give up her faith. Abu Bakr freed Bilal when his master, Umayya ibn Khalaf, placed a heavy rock on his chest in an attempt to force his conversion."

There were many common features between the institution of slavery in the Quran and that of pre-Islamic culture. However, the Quranic institution had some unique new features. According to Brockopp, the idea of using alms for the manumission of slaves who had converted to Islam appears to be unique to the Quran., Islam also prohibits the use of female slaves for prostitution which was common in pre-Islamic history.

Brockopp states that the Qur'an was a progressive legislation on slavery in its time because it encouraged proper treatment.Encyclopedia of the Qur'an, Slaves and Slavery Others state that Islam's record with slavery has been mixed, progressive in Arabian lands, but it increased slavery and worsened abuse as Muslim armies attacked people in Africa, Europe and Asia. Murray notes that Quran sanctified the institution of slavery and abuses therein, but to its credit did not freeze the status of a slave and allowed a means to a slave's manumission in some cases when the slave converted to Islam. "The religious requirement that new slaves be pagans and need for continued imports to maintain slave population made Africa an important source of slaves for the Islamic world. (...) In Islamic tradition, slavery was perceived as a means of converting non-Muslims. One task of the master was religious instruction and theoretically Muslims could not be enslaved. Conversion (of a non-Muslim to Islam) did not automatically lead to emancipation, but assimilation into Muslim society was deemed a prerequisite for emancipation."

Quran

The Quran contains a number of verses aimed at regulating slavery and mitigating its negative impact. It calls for the manumission (freeing) of slaves. It prescribes kindness towards slaves. Slaves are considered morally equal to free persons, however, they have a lower legal standing. All Quranic rules on slaves are emancipatory in that they improve the rights of slaves compared to what was already practiced in the 7th century. The Quran establishes that a thorough massacre is a prerequisite to taking captives of war as slaves. Many Muslims have interpreted Quran as gradually phasing out slavery.

The Quran calls for the freeing of slaves, either the owner manumitting the slave, or a third party purchasing and freeing the slave. The freeing of slaves is encouraged as an act of benevolence,(, , ) and expiation of sins.(, , ) devises a manumission contract in which slaves buy their freedom in installments. Two other verses encourage believers to help slaves pay for such contracts. One of the uses of zakat, a pillar of Islam, is to pay for the freeing of slaves.

The Quran prescribes kind treatment of slaves. Verse calls for good treatment to slaves. The Quran recognizes the humanity of slaves, by calling them "believers", recognizing their desire to be free, and recognizing female slaves' aversion to prostitution.Jonathan E. Brockopp (2000), Early Mālikī Law: Ibn ʻAbd Al-Ḥakam and His Major Compendium of Jurisprudence, Brill, , p. 131 Several verses list slaves as members of the household, sometimes alongside wives, children and other relatives.

The Quran recognizes slaves as morally and spiritually equal to free people. "The Quran acknowledges that slaves do not have the same legal standing as free people; instead they are treated as minors for whom the owners are responsible. But it recommends that unmarried Muslims marry their slaves (24:32), indicating that it considers slaves and free people morally equal." God promises an eternal life in the Hereafter. This equality is indicated in , which addresses free people and slaves as “the one of you is as the other” (ba'dukum min ba'din). refers to master and slave with the same word. However, slaves are not accorded the same legal standing as the free. Slaves are considered as minors for whom the owner is responsible. The punishment for crimes committed by slaves is half the punishment as to be meted out on free persons. The legal distinction between slaves and the free is regarded as the divinely established order of things, which is seen as part of God's grace.