Treatment of prisoners-of-war in Islam
Question

                How are prisoners of war treated in Islam?
Praise be to Allah.
    Islam is the religion of mercy and justice; it commands us to 
    call others to the religion of Allaah in a kind and good manner, and to 
    encourage people to enter this great religion. If some people persist in 
    rejecting the religion of Allaah and stand in the way of ruling by that 
    which Allaah has revealed on earth, or they fight against the call to 
    Allaah, then we give them the choice of three things: 

    Either they become Muslim; or if they refuse they pay the 
    jizyah (whereby they pay a specified amount to the Muslims in return for 
    being allowed to remain their land, and the Muslims undertake to protect 
    them); or, if they refuse that, there is nothing left but the way which they 
    themselves have chosen, which is fighting and dealing violently with those 
    who have persecuted the Muslims and put obstacles in the path of the Islamic 
    da’wah. In this way the Muslims will gain the upper hand and the enemies 
    will be humiliated; then when we have killed and wounded many of them and 
    gained the upper hand over them, we may take prisoners and bind a bond 
    firmly on them [cf. Muhammad 47:4], because in that case it is more in tune 
    with the idea of mercy by choice (not because we are afraid of them); at 
    that point war should not continue any longer than is necessary. War in 
    Islam should not be waged for the sole purpose of shedding blood or seeking 
    vengeance. If the Muslims capture them and take them to a place that has 
    been prepared for them, they should not harm them or torture them with 
    beatings, depriving them of food and water, leaving them out in the sun or 
    the cold, burning them with fire, or putting covers over their mouths, 
    ears and eyes and putting them in cages like animals. Rather they should 
    treat them with kindness and mercy, feed them well and encourage them to 
    enter Islam. 

    Thumaamah ibn Athaal – the leader of Bani Haneefah – was 
    brought (to Madeenah) as a prisoner and tied to one of the pillars of the 
    mosque. The Messenger  (peace and blessings of Allaah be upon him) came 
    to him and said, “What do you think, O Thumaamah?” He said, “What I think, O 
    Muhammad, is good. If you kill me, you will kill one with blood on his hands 
    – i.e., I will deserve to be killed because I have killed Muslims – and if 
    you release me you will release one who will be grateful. If you want money, 
    then ask, and I will give you whatever you want.” The Messenger of Allaah 
     (peace and blessings of Allaah be upon him) left him for three days, 
    and each day he would come and ask him similar questions, and Thumaamah 
    would give similar answers. After the third day, he commanded that he should 
    be released. Thumaamah went to a stand of date-palms near the mosque where 
    he bathed (did ghusl), then he came to the Prophet  (peace and blessings 
    of Allaah be upon him) and said, “I bear witness that there is no god except 
    Allaah and I bear witness that Muhammad is the slave of Allaah and His 
    Messenger.” Then he said: “O Messenger of Allaah, by Allaah there was no one 
    on earth whose face was more hateful to me than yours, but now your face is 
    the most beloved of all faces to me.  By Allaah, there was no religion that 
    was more hateful to me than your religion, but now your religion has become 
    the most beloved of all religions to me. By Allaah, there was no land more 
    hateful to me than your land, but now your land has become the most beloved 
    to me. Your cavalry captured me when I was on my way to perform ‘Umrah, so 
    what do you think I should do?” 

    The Messenger of Allaah  (peace and blessings of Allaah 
    be upon him) congratulated him, and told him to go for ‘Umrah. When he came 
    to Makkah, someone asked him, “Have you changed your religion?” He said, 
    “No, but I have submitted with the Messenger of Allaah  (peace and 
    blessings of Allaah be upon him), and by Allaah you will not get a grain of 
    wheat from al-Yamaamah unless the Messenger of Allaah  (peace and 
    blessings of Allaah be upon him) gives permission.” 

    Think about this story, may Allaah bless you, and how the 
    kind treatment of Thumaamah led to his embracing Islam, which could not have 
    happened were it not primarily by the grace of Allaah, and also the kind 
    treatment which Thumaamah received. 

    In the Qur’aan, Allaah says of the righteous (interpretation 
    of the meaning): 

    “And they give food, in spite of their love for it (or for 
    the love of Him), to the Miskeen (the poor), the orphan, and the captive,

    (Saying): ‘We feed you seeking Allaah’s Countenance only. 
    We wish for no reward, nor thanks from you’”

    [al-Insaan 76:8-9]

    Ibn Katheer (may Allaah have mercy on him) said: “Ibn ‘Abbaas 
    said: in those days their prisoners were mushrikeen; on the day of Badr the 
    Messenger of Allaah  (peace and blessings of Allaah be upon him) 
    commanded them to be kind to their prisoners, so they used to put them 
    before themselves when it came to food… Mujaahid said, this refers to the 
    one who is detained, i.e., they would give food to these prisoners even 
    though they themselves desired it and loved it.” 

    The ruling on tying up prisoners:

     It is well known that if prisoners are able to escape they 
    will not hesitate to do so, because they may be afraid of dying and they do 
    not know what awaits them. Hence the Muslims were commanded to tie up their 
    prisoners and to tie their hands to their necks, lest they run away. This is 
    something that still happens and is well known to all people.

     The wisdom behind permitting the taking of prisoners is so 
    as to weaken the enemy and ward off his evil by keeping him away from the 
    battlefield so that he cannot be effective or play any role; it also creates 
    a means of freeing Muslim prisoners by trading the prisoners whom we are 
    holding.

     Detaining prisoners

     Prisoners should be detained until it is decided what is the 
    best move. The ruler of the Muslims should detain prisoners until he decides 
    what is in the Muslims’ best interests. He may ransom them for money, or 
    exchange them for Muslim prisoners, or release them for nothing in return, 
    or distribute them among the Muslims as slaves, or kill the men, but not the 
    women and children, because the Prophet  (peace and blessings of Allaah 
    be upon him) forbade killing the latter. The purpose behind detaining 
    prisoners is so that the Muslims may be protected from their evil. The 
    Prophet  (peace and blessings of Allaah be upon him) used to enjoin the 
    Muslims to treat prisoners well, whereas the Romans and those who came 
    before them the Assyrians and Pharaohs, all used to put out their prisoners’ 
    eyes with hot irons, and flay them alive, feeding their skins to dogs, such 
    that the prisoners preferred death to life.