The basis of the punishment of apostasy, can be addressed with the following words of the prominent Moroccan scholar Sheikh Abdul Bari Az-Zamzamy:
“It should be noted that Islam never compels any person to accept it or embrace its teachings. It gives the freedom of thinking to people, with full respect to their mentalities and way of thinking. However, Islam is not a man-made religion that is subject to scrutiny or biased criticism that is based on mere suspicion, since it was originated by Allah, the Supreme Creator of all minds and mentalities. In addition, apostasy causes a total disruption and confusion in the Muslim community, and thus, a severe punishment was set for it to deter anyone from thinking of it. It was originally put into force following the Jewish conspiracy against Islam. The details of that conspiracy were simply mass conversion to Islam and then mass apostasy. The main ill aim was to cause confusion and to lead people astray. Thus, the punishment was set as a precautionary measure to stop all these offenses.”
Speaking of the authority of the punishment and its being genuine and based on the authentic sources of Islam, Sheikh `Attiyah Saqr, former Head of Al-Azhar Fatwa Committee, states:
It is not right to deny the punishment of apostasy claiming that it has not been reported in the Qur’an, because it has been recorded in the mutawatir (Hadith which has been reported by at least four of the Companions in different times and places in a way that make a person sure that such Hadith is not fabricated) and the non-mutawatirSunnah of the Prophet (peace and blessing be upon him). Hudud (Islamic punishment specified for certain crimes) may, of course, be based on the non-mutawatir Sunnah.
Detailing the issue and showing some of the evidence for the punishment of apostasy, the prominent Muslim scholar Sheikh Yusuf Al-Qaradawi, states:
“All Muslim jurists agree that the apostate is to be punished. However, they differ regarding the punishment itself. The majority of them go for killing; meaning that an apostate is to be sentenced to death.
Many authentic Hadiths have been reported in this regard. Ibn `Abbas reported that the Prophet (peace and blessings be upon him) said, “Whoever changes his religion, you kill him.” (Reported by all the group except Muslim, and at-Tabarani also reported it with a sound chain of narrators. Also recorded in Majma` Az-Zawa’id by Al-Haythamiy.)
There is also the Hadith of Ibn Mas`ud that the Prophet (peace and blessings be upon him) said, “The blood of a Muslim individual who bears witness that there is no god but Allah and that I am the Messenger of Allah, is not to be shed except in three cases: in retaliation (in murder crimes), married adulterers (and adulteresses), and the one who abandons his religion and forsakes the Muslim community.” (Reported by the Group)
The actual example of one of the greatest Companions, `Ali ibn Abi Talib (may Allah be pleased with him) gives credit to this also. He himself carried out the punishment on some people who had deified him. He gave them three days respite to repent and go back to their senses. When they proved adamant, he put them to fire.”