عَنْ حَكِيمِ بْنِ حِزَامٍ رَضِيَ اللَّهُ عَنْهُ قَالَ: قُلْتُ: يَا رَسُولَ اللَّهِ! أَرَأَيْتَ أُمُورًا كُنْتُ أَتَحَنَّثُ بِهَا فِي الْجَاهِلِيَّةِ مِنْ عَتَاقَةٍ وَصِلَةِ رَحِمٍ هَلْ لِي فِيهَا أَجْرٌ؟ فَقَالَ لَهُ النَّبِيُّ صَلَّى اللَّهُ عَلَيْهِ وَآلِهِ وَسَلَّمَ: ((أَسْلَمْتَ عَلَى مَا أَسْلَفْتَ مِنْ خَيْرٍ))
It is narrated from Sayyiduna Hakim bin Hizam (may Allah be pleased with him), he says: I said, "O Messenger of Allah! What is your opinion about acts such as freeing slaves and maintaining ties of kinship, which I used to do as acts of worship during the time of ignorance? Will I receive a reward for them?" The Prophet (peace and blessings be upon him) said: "You have accepted Islam along with all the good deeds you have already done."
Brief Explanation
Benefits: … From this hadith it is understood that when a person adopts the true religion and then dies upon that religion, even his good deeds from the time of ignorance (Jahiliyyah) are accepted. This is a subject of scholarly disagreement, so we will discuss it in detail:
According to the position of the verifying scholars of Islam, the correct view is that if a disbeliever performs good deeds such as charity and maintaining family ties while in a state of disbelief, and then becomes Muslim, the reward for his previous good deeds is also preserved. Some have even claimed consensus (ijma‘) of the Muslims on this opinion.
However, some people think that this view is contrary to the legal principles (shar‘i qawa‘id). But this view is not Islamic, because in this world, some actions of the disbeliever are considered valid. For example, if a disbeliever pays the expiation (kaffarah) for zihar while in a state of disbelief, then after accepting Islam, there is no need to perform it again.
Hafiz Ibn Hajar said: In this hadith, the writing of the reward is mentioned, not its acceptance. It is possible that acceptance is suspended upon Islam, meaning that if the disbeliever becomes Muslim, his good deeds will also be accepted and he will be given reward for them; otherwise, not. This is the stronger position. Among the earlier scholars, Imam Nawawi, Ibrahim Harbi, and Ibn Battal, and among the later scholars, Imam Qurtubi and Ibn Munir, have supported this view.
Ibn Munir said: There is nothing to prevent that the good deeds which a disbeliever does with good intention while in a state of disbelief, after accepting Islam, Allah ta‘ala grants him reward for those previous good deeds, just as Allah ta‘ala continues to grant reward to a weak Muslim (such as a sick person or a traveler) for those deeds which he used to perform when he had strength and ability, but cannot do during his weakness. If reward can be given for a deed without its performance, then reward can also be given for a deed in which all the conditions are not fully met.
Some scholars of Islam have argued for this issue by citing that when the People of the Book, i.e., Jews and Christians, accept Islam, they are given double reward, as is established from the Qur’an and hadith. But if they die upon Judaism or Christianity, then even their good deeds do not benefit them. Thus, it is known that the good deeds of a disbeliever are written, but the condition for obtaining reward is that he accepts Islam. Consider that when Sayyidah A’ishah radi Allahu anha asked about the righteous deeds of Ibn Jud‘an, whether they would benefit him, the Prophet sallallahu alayhi wa sallam replied: Ibn Jud‘an never said even for a single day: “O my Lord! Forgive my sins on the Day of Resurrection.” From this answer, it is understood that if he had accepted Islam, the good deeds performed during his state of disbelief would have been beneficial for him.
This is the correct position in light of various ahadith, and it is not appropriate for anyone to oppose it. Allamah Sindhi rahimahullah said in his marginal notes on Sunan an-Nasa’i: This hadith indicates that the good deeds of a disbeliever are suspended; if he is honored with Islam, they are accepted, otherwise they are rejected. The following statement of Allah ta‘ala will be applied to those disbelievers who die in a state of disbelief: {وَالَّذِیْنَ کَفَرُوْا اَعْمَالُہُمْ کَسَرَابٍ } (Surah an-Nur: 39) … The deeds of the disbelievers are like a mirage (without reality).
It is clear that there is no evidence against the above-mentioned position. The straightforward matter is that the grace and bounty of Allah ta‘ala is very vast.
Allamah Sindhi rahimahullah, the verse he mentioned, and all such verses in which the warning of deeds being wasted due to shirk is mentioned, have the same meaning. For example, Allah ta‘ala says: {وَلَقَدْ اُوحِیَ اِِلَیْکَ وَاِِلَی الَّذِیْنَ مِنْ قَبْلِکَ لَئِنْ اَشْرَکْتَ لَیَحْبَطَنَّ عَمَلُکَ وَلَتَکُوْنَنَّ مِنَ الْخَاسِرِیْنَ} (Surah az-Zumar: 65) … (O Muhammad!) It has been revealed to you and to those before you that if you commit shirk, surely your deeds will be nullified and you will surely be among the losers.
All these verses and those related to this subject will be applied to the one who dies in a state of shirk, as Allah ta‘ala says: {وَ مَنْ یَّرْتَدِدْ مِنْکُمْ عَنْ دِیْنِہٖ فَیَمُتْ وَ ہُوَ کَافِرٌ فَاُولٰٓئِکَ حَبِطَتْ اَعْمَالُہُمْ فِی الدُّنْیَا وَ الْاٰخِرَۃِ وَ اُولٰٓئِکَ اَصْحٰبُ النَّارِ ہُمْ فِیْہَا خٰلِدُوْن} (Surah al-Baqarah: 217) … And whoever among you turns back from his religion and dies while he is a disbeliever, then their deeds will become worthless in this world and the Hereafter, and they are the companions of the Fire; they will abide therein forever.
Another jurisprudential issue arises from this discussion, and that is: If a Muslim, after performing Hajj, becomes an apostate, and then after apostasy is honored with Islam again, his previous Hajj will not be nullified and it will not be obligatory for him to perform Hajj again. This is the position of Imam Shafi‘i, and one narration from Layth ibn Sa‘d is also in its favor. Imam Ibn Hazm preferred this position and spoke excellently and strongly in its favor. I consider it appropriate to mention it. He says: If a Muslim, after performing Hajj and ‘Umrah, becomes an apostate, then Allah ta‘ala guides him and saves him from Hell and he becomes Muslim again, then it will not be obligatory for him to perform Hajj and ‘Umrah again. This is the position of Imam Shafi‘i, and one narration from Layth ibn Sa‘d is also the same.
Whereas Imam Abu Hanifah, Imam Malik, and Abu Sulayman are of the opinion that his previous Hajj or ‘Umrah will be nullified and he will have to perform this obligation again. They have presented this verse as evidence for their opinion: {لَئِنْ اَشْرَکْتَ لَیَحْبَطَنَّ عَمَلُکَ وَلَتَکُوْنَنَّ مِنَ الْخَاسِرِیْنَ } (Surah az-Zumar: 65) … If you commit shirk, your deeds will be nullified and you will be among the losers. The proponents of this view have presented only this evidence, but in reality, this is not a proof for them, because in this verse it is stated that if a polytheist dies in a state of shirk, his deeds will be nullified. But if he becomes Muslim, his previous righteous deeds will be preserved. This is the truth, there is no doubt in it. Yes, it is agreed that if a polytheist performs acts such as Hajj, ‘Umrah, prayer, fasting, and zakat while in a state of shirk, these obligations will not suffice for him (because it is necessary to perform these acts with the conditions and restrictions of the Shari‘ah). Consider the last phrase of this verse: {وَلَتَکُوْنَنَّ مِنَ الْخَاسِرِیْن} (and you will be among the losers). From this phrase, it is also correct to infer that if an apostate is honored with Islam again, the righteous deeds performed before accepting Islam will not be nullified, rather they will be recorded and he will be given their reward, because the Muslim Ummah is agreed that if an apostate accepts Islam again, he will certainly be among the successful and prosperous, and will no longer be among the losers. Thus, it is known that the one whose deeds are nullified is the one who dies in a state of disbelief, shirk, or apostasy.
Consider, Allah ta‘ala says: {وَ مَنْ یَّرْتَدِدْ مِنْکُمْ عَنْ دِیْنِہٖ فَیَمُتْ وَ ہُوَ کَافِرٌ فَاُولٰٓئِکَ حَبِطَتْ اَعْمَالُہُمْ فِی الدُّنْیَا وَ الْاٰخِرَۃِ وَ اُولٰٓئِکَ اَصْحٰبُ النَّارِ ہُمْ فِیْہَا خٰلِدُوْن} (Surah al-Baqarah: 217) … And whoever among you turns back from his religion and dies while he is a disbeliever, then their deeds will become worthless in this world and the Hereafter, and they are the companions of the Fire; they will abide therein forever. In this noble verse, it has been clarified that the deeds of the apostate will be nullified when he dies in a state of disbelief. Also, the following statements of Allah ta‘ala are general regarding the preservation of good deeds: {اَنِّیْ لَآ اُضِیْعُ عَمَلَ عَامِلٍ مِّنْکُمْ مِّنْ ذَکَرٍ اَوْ اُنْثٰی } (Surah Al ‘Imran: 195) … I do not let the work of any worker among you go to waste, whether male or female. {فَمَنْ یَّعْمَلْ مِثْقَالَ ذَرَّۃٍ خَیْرًا یَّرَہ} (Surah az-Zalzalah: 7) … Whoever does an atom’s weight of good will see it. These are general verses about the preservation of good deeds and their not being wasted, and they cannot be specified without evidence. Thus, it is known that when an apostate accepts Islam again, his previous Hajj and ‘Umrah are preserved.