Praise be to Allah.
Capital punishment applies in the case of a person who meets any of the following conditions:
1 – The apostate. The apostate is one who disbelieves after being a Muslim, because the Prophet (peace and blessings of Allaah be upon him) said: “Whoever changes his religion, execute him.” Narrated by al-Bukhaari, 6524.
2 – The married adulterer. The punishment in this case is to be stoned to death.
Al-muhsan or the married person here means one who got married and had intercourse with his wife in the vagina, in a legitimate marriage in which both parties are free, of sound mind and adults. If a married man or woman commits adultery, then they are to be stoned to death, because the Prophet (peace and blessings of Allaah be upon him) said: “Learn from me. Allaah has given them a way out. If an unmarried person commits fornication with an unmarried person, (the punishment is) one hundred lashes and exile for one year. If a married person commits adultery with a married person, (the punishment is) one hundred lashes and stoning.” (Narrated by Muslim, 1690).
And al-Bukhaari (2725) and Muslim (1698) narrated from Abu Hurayrah and Zayd ibn Khaalid al-Juhani (may Allaah be pleased with them) that they said: “Two men from among the Bedouin came to the Messenger of Allaah (peace and blessings of Allaah be upon him) and said, ‘O Messenger of Allaah, I adjure you by Allaah to judge me according to the Book of Allaah.’ The other disputant – who was smarter – said: ‘Yes, judge between us according to the Book of Allaah and give me permission to speak first.’
The Messenger of Allaah (peace and blessings of Allaah be upon him) said, ‘Speak.’
He said, ‘My son was employed by this man, and he committed adultery with his wife. I was told that the punishment for my son would be stoning, but that he could be ransomed for one hundred sheep and their offspring. I asked the people of knowledge and they told me that the punishment for my son would be one hundred lashes and exile for one year, and that this woman would be stoned.’
The Messenger of Allaah (S) said: ‘By the One in Whose hand is my soul, I will judge between you according to the Book of Allaah. The offspring and sheep will be returned (i.e., there is no ransom), and your son is to be given one hundred lashes and exiled for one year. O Unays [who was one of the Sahaabah], go tomorrow to that woman and if she admits (this crime) then stone her.’ So he went to her the next day and she admitted it, and the Messenger of Allaah (peace and blessings of Allaah be upon him) issued orders that she be stoned.
3 – The murderer (one who kills deliberately). He is to be killed in retaliation (qisaas) unless the victim’s next of kin let him off or agree to accept the diyah (blood money), because Allaah says (interpretation of the meaning):
“O you who believe! Al-Qisaas (the Law of Equality in punishment) is prescribed for you in case of murder: the free for the free, the slave for the slave, and the female for the female. But if the killer is forgiven by the brother (or the relatives) of the killed against blood money, then adhering to it with fairness and payment of the blood money to the heir should be made in fairness. This is an alleviation and a mercy from your Lord. So after this whoever transgresses the limits (i.e. kills the killer after taking the blood money), he shall have a painful torment”
“And there is (a saving of) life for you in Al-Qisaas (the Law of Equality in punishment), O men of understanding, that you may become Al-Muttaqoon (the pious)”
And the Prophet (peace and blessings of Allaah be upon him) said: “It is not permissible (to shed) the blood of a Muslim who bears witness that there is no god but Allaah and that I am the Messenger of Allaah, except in three cases: a married adulterer, a soul for a soul, or one who leaves the religion and splits from the jamaa’ah.”
Narrated by al-Bukhaari, 6484; Muslim, 1676).
4 – Bandits, i.e., al-muhaarib, the one who wages war against Allaah and His Messenger. Allaah says (interpretation of the meaning):
“The recompense of those who wage war against Allaah and His Messenger and do mischief in the land is only that they shall be killed or crucified or their hands and their feet be cut off from opposite sides, or be exiled from the land. That is their disgrace in this world, and a great torment is theirs in the Hereafter”
5 – Spies. The spy is the one who spies on the Muslims and transmits information to their enemies.
The evidence for that is the report narrated by al-Bukhaari (3007) and Muslim (2494) which says that Haatib ibn Abi Balta’ah wrote to some of the mushrikeen in Makkah telling them some information about the Messenger of Allaah (peace and blessings of Allaah be upon him). The Messenger of Allaah (peace and blessings of Allaah be upon him) said: “O Haatib, what is this?” He said, “O Messenger of Allaah, do not hasten to judge me. I was a man closely connected to Quraysh, but I did not belong to this tribe, while the other Muhaajireen with you had their relatives in Makkah who would protect their families and property. So I wanted to make up for my lack of blood ties to them by doing them a favor so that they might protect my family. I did not do this because of disbelief or apostasy nor out of preferring kufr (disbelief) to Islam.” The Messenger of Allaah (peace and blessings of Allaah be upon him) said, “He has told you the truth.” ‘Umar said, “O Messenger of Allaah! Let me chop off the head of this hypocrite!” The Messenger of Allaah (peace and blessings of Allaah be upon him) said: “He was present at the battle of Badr, and you do not know, perhaps Allaah looked at the people of Badr and said, ‘Do whatever you like, for I have forgiven you.’”
The point in this hadeeth is that the Prophet (peace and blessings of Allaah be upon him) agreed with ‘Umar that Haatib deserved to be executed for this action, but the Prophet (peace and blessings of Allaah be upon him) told him that there was a reason why he should not be killed, which is that he was one of those who was present at the battle of Badr.
Ibn al-Qayyim said in Zaad al-Ma’aad (2/115) concerning the hadeeth of Haatib ibn Abi Balta’ah:
This was quoted as evidence by those who do not think that the Muslim spy should be killed, such as al-Shaafa’i, Ahmad and Abu Haneefah (may Allaah have mercy on them). And it was quoted as evidence by those who think that the spy should be killed, such as Maalik and Ibn ‘Aqeel among the companions of Ahmad, and others. They said: This is because the reason for not killing him was that he had been present at Badr. If being Muslim was the reason for not killing him, he would not have given a reason that is more specific, which is the fact that he had been present at Badr.
And he said elsewhere in Zaad al-Ma’aad (3/422):
The correct view is that execution of a spy depends on the opinion of the ruler; if executing him is in the Muslims’ interests, he should be executed, but if letting him live serves a greater interest, then he should be allowed to live. And Allaah knows best.
The above also includes the one who does not pray, the one who practices witchcraft, and the heretic, because they come under the heading of “the one who leaves his religion and splits from the jamaa’ah.”
With regard to the conditions of implementing this punishment, there are many. Each crime has its own specific conditions, details of which may be found in the books of fiqh.
To learn more about the wisdom behind executing the apostate and the married adulterer, see question no. 20327.
And Allaah knows best.