Sahih al-Bukhari 1436
Sahih al-Bukhari · Book 24: Obligatory Charity Tax (Zakat) · Whoever gave things in charity while he was a Mushrik and then embraced Islam
Narrated Hakim bin Hizam:
حَدَّثَنَا عَبْدُ اللَّهِ بْنُ مُحَمَّدٍ ، حَدَّثَنَا هِشَامٌ ، حَدَّثَنَا مَعْمَرٌ ، عَنِ الزُّهْرِيِّ ، عَنْ عُرْوَةَ ، عَنْ حَكِيمِ بْنِ حِزَامٍ ـ رضى الله عنه ـ قَالَ قُلْتُ يَا رَسُولَ اللَّهِ أَرَأَيْتَ أَشْيَاءَ كُنْتُ أَتَحَنَّثُ بِهَا فِي الْجَاهِلِيَّةِ مِنْ صَدَقَةٍ أَوْ عَتَاقَةٍ وَصِلَةِ رَحِمٍ فَهَلْ فِيهَا مِنْ أَجْرٍ فَقَالَ النَّبِيُّ صلى الله عليه وسلم " أَسْلَمْتَ عَلَى مَا سَلَفَ مِنْ خَيْرٍ " .
I said to Allah's Messenger (ﷺ), "Before embracing Islam I used to do good deeds like giving in charity, slave-manumitting, and the keeping of good relations with Kith and kin. Shall I be rewarded for those deeds?" The Prophet (ﷺ) replied, "You became Muslim with all those good deeds (Without losing their reward)."