Mishkat al-Masabih 2123
Abū Huraira said:
I had been placed in charge of the zakāt of Ramadān by God’s messenger, and when someone came to me and began to take up handfuls of the food, I seized him and told him I was certainly going to take him before God’s messenger. But when he said, “I am needy, have children dependent on me, and my need is great,” I let him go. In the morning the Prophet asked, “What happened to your prisoner last night, Abū Huraira?” and I replied, “Messenger of God, he complained of great need and of having children dependent on him, so I had pity on him and let him go.” He said, “He lied to you, and he will come back.” I realised that he would return because God’s messenger had told me so, and therefore I lay in wait for him. When he came and began to take up handfuls of the food, I seized him and told him I was certainly going to take him before God's messenger; but when he said, “Let me go, for I am needy with children dependent on me, and I shall not return” I had pity on him and let him go. In the morning God’s messenger asked me, “What has happened to your prisoner, Abū Huraira?” and I replied, “Messenger of God, he complained of great need and of having children dependent on him, so I had pity on him and let him go.” He said, “He has certainly lied to you, and he will come back,” so I lay in wait for him, and when he came and took up handfuls of food I seized him and said, “I am certainly going to take you before God’s messenger, for this is the third time you assert you will not return, and then you do.” He said, “If you let me go I will teach you some words by which God will benefit you. When you go to your bed recite the Throne Verse (Qur’ān 2:255), ‘God, there is no god but He, the Living, the Eternal’ to the end of the verse, for a guardian from God will then remain over you and no devil will come near you till the morning.” I therefore let him go, and in the morning God’s messenger asked me, “What has happened to your prisoner?” I replied, “He asserted that he would teach me some words by which God would benefit me.” He said, “He has certainly told you the truth though he is a great liar. Do you know to whom you have been talking for, three nights?” When I replied that I did not, he said, “That was a devil.”

Bukhārī transmit­ted it.
وَعَنْ أَبِي هُرَيْرَةَ رَضِيَ اللَّهُ عَنْهُ قَالَ: وَكَّلَنِي رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ بِحِفْظِ زَكَاةِ رَمَضَانَ فَأَتَانِي آتٍ فَجَعَلَ يَحْثُو من الطَّعَام فَأَخَذته وَقلت وَالله لَأَرْفَعَنَّكَ إِلَى رَسُولِ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ قَالَ إِنِّي مُحْتَاجٌ وَعَلَيَّ عِيَالٌ وَلِي حَاجَةٌ شَدِيدَةٌ قَالَ فَخَلَّيْتُ عَنْهُ فَأَصْبَحْتُ فَقَالَ النَّبِيُّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: «يَا أَبَا هُرَيْرَة مَا فعل أسيرك البارحة» . قَالَ قُلْتُ يَا رَسُولَ اللَّهِ شَكَا حَاجَةً شَدِيدَةً وَعِيَالًا فَرَحِمْتُهُ فَخَلَّيْتُ سَبِيلَهُ قَالَ: «أَمَا إِنَّهُ قَدْ كَذَبَكَ وَسَيَعُودُ» . فَعَرَفْتُ أَنَّهُ سَيَعُودُ لِقَوْلِ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: «أَنَّهُ سيعود» . فَرَصَدْتُهُ فَجَاءَ يَحْثُو مِنَ الطَّعَامِ فَأَخَذْتُهُ فَقُلْتُ: لَأَرْفَعَنَّكَ إِلَى رَسُولِ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ قَالَ دَعْنِي فَإِنِّي مُحْتَاجٌ وَعَلَيَّ عِيَالٌ لَا أَعُودُ فَرَحِمْتُهُ فَخَلَّيْتُ سَبِيلَهُ فَأَصْبَحْتُ فَقَالَ لِي رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: «يَا أَبَا هُرَيْرَةَ مَا فَعَلَ أَسِيرُكَ؟» قُلْتُ يَا رَسُولَ اللَّهِ شَكَا حَاجَةً شَدِيدَةً وَعِيَالًا فَرَحِمْتُهُ فَخَلَّيْتُ سَبِيلَهُ قَالَ: «أَمَا إِنَّهُ قَدْ كَذبك وَسَيَعُودُ» . فرصدته الثَّالِثَة فَجَاءَ يَحْثُو مِنَ الطَّعَامِ فَأَخَذْتُهُ فَقُلْتُ لَأَرْفَعَنَّكَ إِلَى رَسُول الله وَهَذَا آخِرُ ثَلَاثِ مَرَّاتٍ إِنَّكَ تَزْعُمُ لَا تَعُودُ ثُمَّ تَعُودُ قَالَ دَعْنِي أُعَلِّمُكَ كَلِمَاتٍ ينفعك الله بهَا قلت مَا هُوَ قَالَ إِذَا أَوَيْتَ إِلَى فِرَاشِكَ فَاقْرَأْ آيَةَ الْكُرْسِيِّ (اللَّهُ لَا إِلَهَ إِلَّا هُوَ الْحَيُّ الْقَيُّومُ)
حَتَّى تَخْتِمَ الْآيَةَ فَإِنَّكَ لَنْ يَزَالَ عَلَيْكَ من الله حَافظ وَلَا يقربنك شَيْطَانٌ حَتَّى تُصْبِحَ فَخَلَّيْتُ سَبِيلَهُ فَأَصْبَحْتُ فَقَالَ لِي رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: «مَا فَعَلَ أَسِيرُكَ؟» قُلْتُ: زَعَمَ أَنَّهُ يُعَلِّمُنِي كَلِمَات يَنْفَعنِي الله بهَا فخليت سبيلهقال النَّبِي صلى الله عَلَيْهِ وَسلم: «أما إِنَّه قد صدقك وَهُوَ كذوب تعلم من تخاطب مُنْذُ ثَلَاث لَيَال» . يَا أَبَا هُرَيْرَة قَالَ لَا قَالَ: «ذَاك شَيْطَان» . رَوَاهُ البُخَارِيّ