The treatment of captives in Islam set it on a higher moral level than every other system that preceded it. The prophet Muhammad (S) ensured that they be treated with kindness. So, we find that captives of the Battle of Badr were better fed than those who were entrusted to hold them. Many of those poor companions of the Prophet (S) remained hungry while they fed those captives. So overwhelming was the influence of kind treatment of the non-Muslim captives that many of those former captives quickly embraced Islam, let alone renouncing violence against the nascent Islamic state. This tradition continued throughout the Caliphate of the righteous companions.
During his rule, Caliph Umar made it illegal to separate related prisoners of war from each other, after a captive complained to him for being separated from her daughter.[Naqvi (2000), pg. 456]
These principles were also honoured during the Crusades, as exemplified by sultans such as Saladin and al-Kamil. For example, after al-Kamil defeated the Franks during the Crusades, Oliverus Scholasticus praised the Islamic laws of war, commenting on how al-Kamil supplied the defeated Frankish army with food:
"Who could doubt that such goodness, friendship and charity come from God? Men whose parents, sons and daughters, brothers and sisters, had died in agony at our hands, whose lands we took, whom we drove naked from their homes, revived us with their own food when we were dying of hunger and showered us with kindness even when we were in their power." [Judge Weeramantry, Christopher G. (1997). Justice Without Frontiers. Brill Publishers. pp. 136.]
As hinted above, upon capture, the prisoners must be guarded and not ill-treated.[Nigosian, S. A. (2004). Islam. Its History, Teaching, and Practices. Bloomington: Indiana University Press. p. 115.] Islamic law holds that the prisoners must be fed and clothed, either by the Islamic government or by the individual who has custody of the prisoner. This position is supported by the verse [Qur'an 76:8] of the Quran. The prisoners must be fed in a dignified manner, and must not be forced to beg for their subsistence.[Maududi (1967), introduction of Ad-Dahr, "Period of revelation", pg. 159] Muhammad's early followers also considered it a principle to not separate prisoners from their relatives.[Naqvi (2000), pg. 456]
After the fighting is over, prisoners are to be released, with some prospect of survival, or ransomed. The freeing or ransoming of prisoners by Muslims themselves is highly recommended as a charitable act.[Nigosian, S. A. (2004)] The Qur'an also urges kindness to captives ([Qur'an 4:36], [Qur'an 9:60], [Qur'an 24:58]) and recommends, their liberation by purchase or manumission. The freeing of captives is recommended both for the expiation of sins ([Qur'an 4:92], [Qur'an 5:92], [Qur'an 58:3]) and as an act of simple benevolence.([Qur'an 2:177], [Qur'an 24:33], [Qur'an 90:13])
Muslim scholars hold that women and children prisoners of war cannot be killed under any circumstances, regardless of their faith.
Muslim scholars prohibit altogether the killing of prisoners and hold that this was the policy practiced by Prophet Muhammad. The 20th century Muslim scholar, Sayyid Abul Ala Maududi states that no prisoner should be "put to the sword" in accordance with a saying of Muhammad.
Yusuf Ali, another 20th century Muslim scholar, while commenting on verse [Qur'an 9:6], writes, "Even those the enemies of Islam, actively fighting against Islam, there may be individuals who may be in a position to require protection. Full asylum is to be given to them, and opportunities provided for hearing the Word of Allah...If they do not see their way to accept Islam, they will require double protection: (1) from the Islamic forces openly fighting against their people, and (2) from their own people, as they detached themselves from them. Both kinds of protection should be ensured for them, and they should be safely escorted to a place where they can be safe." [Ali, Abdullah Yusuf (1991). The Holy Quran. Medina: King Fahd Holy Qur-an Printing Complex.]
Maududi further states that Islam forbids torturing, especially by fire, and quotes Muhamad as saying, "Punishment by fire does not behoove anyone except the Master of the Fire [God]."
According to a French author, "By guaranteeing them [male POWs] humane treatment, and various possibilities of subsequently releasing themselves, it ensured that a good number of combatants in the opposing armies preferred captivity at the hands of Muslims to death on the field of battle." [Wikipedia]