Hadithcore
Sahih al-Bukhari, 1421
sahih

Narrated Abu Huraira:

Allah's Messenger (ﷺ) said, "A man said that he would give something in charity. He went out with his object of charity and unknowingly gave it to a thief. Next morning the people said that he had given his object of charity to a thief. (On hearing that) he said, "O Allah! All the praises are for you. I will give alms again." And so he again went out with his alms and (unknowingly) gave it to an adulteress. Next morning the people said that he had given his alms to an adulteress last night. The man said, "O Allah! All the praises are for you. (I gave my alms) to an adulteress. I will give alms again." So he went out with his alms again and (unknowingly) gave it to a rich person. (The people) next morning said that he had given his alms to a wealthy person. He said, "O Allah! All the praises are for you. (I had given alms) to a thief, to an adulteress and to a wealthy man." Then someone came and said to him, "The alms which you gave to the thief, might make him abstain from stealing, and that given to the adulteress might make her abstain from illegal sexual intercourse (adultery), and that given to the wealthy man might make him take a lesson from it and spend his wealth which Allah has given him, in Allah's cause."

حَدَّثَنَا أَبُو الْيَمَانِ، أَخْبَرَنَا شُعَيْبٌ، حَدَّثَنَا أَبُو الزِّنَادِ، عَنِ الأَعْرَجِ، عَنْ أَبِي هُرَيْرَةَ ـ رضى الله عنه ـ أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم قَالَ ‏

‏ قَالَ رَجُلٌ لأَتَصَدَّقَنَّ بِصَدَقَةٍ‏.‏ فَخَرَجَ بِصَدَقَتِهِ فَوَضَعَهَا فِي يَدِ سَارِقٍ فَأَصْبَحُوا يَتَحَدَّثُونَ تُصُدِّقَ عَلَى سَارِقٍ‏.‏ فَقَالَ اللَّهُمَّ لَكَ الْحَمْدُ لأَتَصَدَّقَنَّ بِصَدَقَةٍ‏.‏ فَخَرَجَ بِصَدَقَتِهِ فَوَضَعَهَا فِي يَدَىْ زَانِيَةٍ، فَأَصْبَحُوا يَتَحَدَّثُونَ تُصُدِّقَ اللَّيْلَةَ عَلَى زَانِيَةٍ‏.‏ فَقَالَ اللَّهُمَّ لَكَ الْحَمْدُ عَلَى زَانِيَةٍ، لأَتَصَدَّقَنَّ بِصَدَقَةٍ‏.‏ فَخَرَجَ بِصَدَقَتِهِ فَوَضَعَهَا فِي يَدَىْ غَنِيٍّ فَأَصْبَحُوا يَتَحَدَّثُونَ تُصُدِّقَ عَلَى غَنِيٍّ فَقَالَ اللَّهُمَّ لَكَ الْحَمْدُ، عَلَى سَارِقٍ وَعَلَى زَانِيَةٍ وَعَلَى غَنِيٍّ‏.‏ فَأُتِيَ فَقِيلَ لَهُ أَمَّا صَدَقَتُكَ عَلَى سَارِقٍ فَلَعَلَّهُ أَنْ يَسْتَعِفَّ عَنْ سَرِقَتِهِ، وَأَمَّا الزَّانِيَةُ فَلَعَلَّهَا أَنْ تَسْتَعِفَّ عَنْ زِنَاهَا، وَأَمَّا الْغَنِيُّ فَلَعَلَّهُ يَعْتَبِرُ فَيُنْفِقُ مِمَّا أَعْطَاهُ اللَّهُ ‏

‏‏.‏

References2 variants
In-Book Reference
Book 24, Hadith 25
USC-MSA web (English) reference
Vol. 2, Book 24, Hadith 502 (deprecated numbering scheme)
Sharh · explanationclick to expand
Charity is one of the best deeds which a person can offer himself, and he obtains its great reward from Allah, The Almighty. In this hadeeth, The Prophet ﷺ tells us about a man - it was said that he was from Banee ‘Israa’eel - who went out to offer alms [to those in need]. So, his alms went into the hands of a thief once. And then in the hand of an adulteress once more. And in the hand of a rich man a third time. In every instance, the people would rise in the morning, talking about what he did in amazement; because charity, according to them, was dedicated to the needy people from amongst the charitable; and that is why they marvelled at the charity that was offered to these people. The man praised Allah, The Mighty and Majestic; for he had intended for his charity to fall into the hands of an upright poor person that no one knows about his poverty, or an honourable, honest man, or a chaste woman. But Allah’s Decree is a predetermined, divine preordainment, so the man was brought into a dream, and was told that his charity was accepted, as what is narrated in a report in Musnad Ahmad because he was sincere and had intended to do good, however, it was not facilitated for him. It was said to him: ‘As for your charity for the thief, perhaps the thief will abstain from stealing. Maybe the burglar will say: ‘This money will suffice me’ or that he is embarrassed that he had been provided for without stealing, and he knows that, among the servants of Allah, there are those who offer alms in secret at night to those who do not know him. As for the prostitute who commits fornication as an occupation, perhaps she may abstain from it because she may have committed adultery – we seek refuge in Allah from such sin - with the purpose of [earning] money, and something happened to her which stopped her from doing so again. As to the rich man, maybe he will reflect and learn a lesson, causing him to spend from what Allah has given him. This is how a good intention will yield wholesome fruits. From the other benefits that we can conclude from this hadeeth is that it indicates that when a person intends goodness, and strives towards it, and makes a mistake; it is because it was written for him, and it will not harm him. It shows that the legal ruling [for a matter] is given based on what appears, until it becomes clear otherwise. It encourages us to submit and be content with the Divine Decree, and praise Allah, and entrust all of your concerns and affairs to Allah, The Mighty and Majestic. And lastly, it teaches us that we should give charity and alms again if it did not fall in its proper place [i.e., be received by its rightful recipients]..
Related hadiths3
Compare isnād across 3 related chains →