Before the advent of Islam, slavery was a deep-rooted system in the world. Then Islam came with rules and regulations to gradually end the system of servitude and bondage. For example, a master was permitted under Islamic law to have intercourse with his slave girl, but if she bore a child, the child would be a free person and the master could no longer sell the mother. For this reason, slave girls wished that their masters would have intercourse with them instead of marrying them to slave men so that they could be protected from the slave trade and their children would be free. In addition, Islam made the manumission of slaves a form of expiation or kaffarah for many sins so as to end slavery.
Islam thus closed all the doors leading to slavery and founded means for the manumission of slaves 1400 years ago; whereas non-Muslims only rooted out slavery less than 200 years ago.
As for the enslavement of war captives, Muslim jurists ascribed the right to decide this and other issues to the imam of the Muslim nation. However, nowadays the Muslims no longer have this choice, in accordance with international agreements that ban enslavement.

In this respect, Sheikh Faysal Mawlawi, Deputy Chairman of the European Council for Fatwa and Research, states the following:
I’d like to clarify this issue briefly in some specific points:
1. Man is honored in Islam as a human being. Allah the Almighty says: “Verily we have honored the Children of Adam. We carry them on the land and the sea, and have ma
de provision of good things for them, and have preferred them above many of those whom We created with a marked preferment”
(Al-Israa’: 70). Man is given free will in all optional matters, foremost of which is either to believe or disbelieve. Allah the Almighty says: “Say: (It is) the truth from the Lord of you (all). Then whosoever will, let him believe, and whosoever will, let him disbelieve” (Al-Kahf: 29). Allah has enjoined man to be servant to none but Allah, as He the Exalted says: “And serve Allah. Ascribe no thing as partner unto Him” (An-Nisaa’: 36).
Thereupon, enslavement of fellow human beings is not acceptable in Islam, which states that man must not be a slave to anybody except Allah the Almighty.
2. When the Prophet (peace and blessings be upon him) was sent, slavery was in force all over the world. Hence, he dealt with it as the status quo, but he declared a group of Islamic rules that are directed to terminating the system of slavery altogether:
a. He legislated `akd al-mukatabah, which is a contract between a slave and his master indicating that the slave buys himself from his master for a specific amount of money. According to this contract, the slave works to collect money to pay his price to the master. The Muslims also can help him obtain his freedom by giving him from the money of zakah, as this is one of eight channels in which zakah can be given. Such type of contract was not found before the Prophet (peace and blessings be upon him) legislated it.
b.The Prophet (peace and blessings be upon him) also made freeing slaves a type of kaffarah or expiation for many sins such as breaking a vow or an oath, zihar (declaring one’s wife as unlawful for one as one’s mother), manslaughter, and having sex
ual intercourse with one’s spouse during the fast days of Ramadan.
c.The Prophet (peace and blessings be upon him) also encouraged ending slavery by encouraging people to free their slaves, declaring that it is a charitable act that draws Allah’s pleasure, delivers one from the Hellfire, and makes one worthy to enter Paradise in the hereafter. Allah the Almighty says: “But he hath not attempted the Ascent. Ah, what will convey unto thee what the Ascent is! (It is) to free a slave.” (Al-Balad: 11–13)
d. The Prophet (peace and blessings be upon him) also established a penalty against a master who hits his slave severely: to free that slave. He also made freeing a slave a recommendable act if his master hits him mildly. It is reported that Abu `Ubaydah ibn Al-Jarrah (may Allah be pleased with him) was hitting his slave. Upon seeing him, the Prophet (peace and blessings be upon him) said to him: “Allah’s authority over you is more than yours over him (the slave).” Hence, Abu `Ubaydah realized his mistake and freed the slave at once saying: “O Messenger of Allah! He is free for the sake of Allah.” The Prophet (peace and blessings be upon him) replied: “Unless you do so, you will be tortured in the Hellfire” (Reported by Muslim).
3. Although the Glorious Qur’an includes the ruling of several issues, there is no textual evidence in the Qur’an or in the Sunnah of the Prophet (peace and blessings be upon him) that permits slavery. This indicates that the legalization of slavery was just dealing with the status quo in order to reform it, or a response to the enemies of Islam to deal with them in the same way they dealt with the Muslims in war.
4. Islam has dealt with the already enslaved people in a mild humanitarian way by calling for the manumission of slaves. At the same time, Islam prohibited the enslavement of free people, as the Prophet (peace and blessings be upon him) said: “Allah says, ‘I will be against three persons on the Day of Resurrection: one who makes a covenant in My Name but he proves treacherous; one who sells a free person (as a slave) and eats the price; and one who employs a laborer and gets the full work done by him but does not pay him his wages’“ (Reported by Al-Bukhari).
5. Islam never legalizes enslavement unless the war outcomes urges that. Here, we should note some important points:
a. The Glorious Qur’an does not contain anything indicating the permissibility of enslavement due to the state of war. The sanctified Qur’anic verse that explicitly deals with this issue declares that after war comes to an end, the Islamic ruling concerning the non-Muslim enemy captives is to set them free either for ransom or for nothing in return. The verse reads: “Now, when ye meet in battle those who disbelieve, then it is smiting of the necks until, when ye have routed them, then making fast of bonds; and afterward either grace or ransom till the war lay down its burdens” (Muhammad: 4). This verse is not abrogated, according to the consensus of Muslim scholars, including the Maliki, Shafi`i and Hanbali schools of fiqh.
In addition to these two options—releasing the captives either for ransom or for nothing in return—the scholars agree on two other options: killing the captives or enslaving them. They maintain that choosing one of these four options is ascribed to the imam to decide it according to the Muslims’ welfare. Killing the captive in this case is not just because of his being in captivity. It is essentially for some other reason. For example, the Prophet (pace and blessings be upon him) killed the poet Abu `Azzah Al-Jamhiy on the day of Uhud because he breached the agreement, he had made with him. The man had been captured on the Day of Badr beforehand, and the Prophet (peace and blessings be upon him) released him on condition that he would never lampoon the Prophet (peace and blessings be upon him) in his poetry. However, the man broke his promise and returned to satirizing the Prophet (peace and blessings be upon him) and his Companions. Hence, the Prophet (peace and blessings be upon him) killed him. Also, the Prophet (peace and blessings be upon him) killed the people of the Qurayzah tribe when they breached the agreement, they had made with him by joining the enemy allies against the Muslims. In so doing they were likely to bring about the ruin of the Muslims altogether.
The Prophet (peace and blessings be upon him) permitted his Companions to enslave the non-Muslim captives if the enemy started treating the Muslim captives in this way. He thus permitted them to respond with the like, but he never did it himself. For example, the Prophet (peace and blessing be upon him) did not enslave the captives of the Battle of Badr; he released them for ransom. On that occasion, Allah the Almighty admonished His Messenger, for it was better to kill those captives. However, Allah the Almighty did not make any mention of enslaving them. In the battle with Banu Qurayzah, the Prophet (peace and blessings be upon him) killed all the captives and never enslaved them. However, he enslaved the women and the children because it is prohibited to kill them because they are noncombatants. At the Conquest of Makkah, the Prophet (peace and blessings be upon him) set all the captives free for nothing in return. In the battle with Banu Al-Mustaliq, the Muslims enslaved the captives according to the traditions of that period. Hence, the Prophet (peace and blessings be upon him) married Juwairyah the daughter of the leader of Banu Al-Mustaliq. Upon that, the Prophet’s Companions (may Allah be pleased with them all) hastened to free the captives they had, saying, “Shall we enslave the Prophet’s in-laws?” (They saw it improper for them to do so.)
b. The Muslims must accept the international laws and regulations that ban the enslavement of POWs and impose exchanging them for national captives. Such laws are better for the Muslims and more relevant to Islamic law. Exchanging the POWs actually protects the Muslims from being enslaved by the enemy, which is a very evil thing. Although enslavement of the enemy captives would be a great victory for the Muslims, it is established that warding off evil is prior to achieving good things, based on a famous juristic rule.
Moreover, the Prophet (peace and blessings be upon him) not only legalized but also encouraged the exchange of POWs in many of his sayings. It has been reported on the authority of Salama ibn Al-Akwa` that the Muslims fought against the Fazara tribe. Some of the enemies were killed and some were captured. Among them was a woman from Banu Fazara with her daughter, who was one of the prettiest girls in Arabia. Salama drove them along until he brought them to Abu Bakr, who granted that girl to Salama as a prize. He had not yet disrobed her when the Messenger of Allah (may peace be upon him) met him in the street and said, “Give me that girl, Salama.” The man said, “Messenger of Allah, she has fascinated me. I have not yet disrobed her.” When on the next day, the Messenger of Allah (may peace be upon him) again met him in the street, he said, “Salama, give me that girl, may Allah bless your father.” The man said, “She is for you, Messenger of Allah. By Allah, I have not yet disrobed her.” The Messenger of Allah (may peace and blessings be upon him) sent her to the people of Makkah, and surrendered her as ransom for a number of Muslims who had been kept as prisoners at Makkah. (Reported by Muslim in the Book of Syar) Scholars of different schools of fiqh legalize the exchange of POWs.
In conclusion, based on what is mentioned above, it is by no means permissible nowadays to enslave POWs, even if that is done after the end of war. If the Muslims did so, they would breach the international treaties that ban the enslavement of POWs, and this would subject the Muslim POWs to enslavement by the enemy. However, if the enemies of Islam violated such treaties, the Muslims can do the like, out of treating the enemy in a similar manner. After all, the decision to enslave or release the non-Muslim POWs is to be taken only by the imam, not by any member of the Muslim community.”