Narrated Abu Huraira:
Allahs Messenger ﷺ deputed me to keep Sadaqat (al-Fitr) of Ramadan. A comer came and started taking handfuls of the foodstuff (of the Sadaqa) (stealthily). I took hold of him and said, "By Allah, I will take you to Allahs Messenger ﷺ." He said, "I am needy and have many dependents, and I am in great need." I released him, and in the morning Allahs Messenger ﷺ asked me, "What did your prisoner do yesterday?" I said, "O Allahs Messenger ﷺ! The person complained of being needy and of having many dependents, so, I pitied him and let him go." Allahs Messenger ﷺ said, "Indeed, he told you a lie and he will be coming again." I believed that he would show up again as Allahs Messenger ﷺ had told me that he would return. So, I waited for him watchfully. When he (showed up and) started stealing handfuls of foodstuff, I caught hold of him again and said, "I will definitely take you to Allahs Messenger ﷺ. He said, "Leave me, for I am very needy and have many dependents. I promise I will not come back again." I pitied him and let him go.
In the morning Allahs Messenger ﷺ asked me, "What did your prisoner do." I replied, "O Allahs Messenger ﷺ! He complained of his great need and of too many dependents, so I took pity on him and set him free." Allahs Apostle said, "Verily, he told you a lie and he will return." I waited for him attentively for the third time, and when he (came and) started stealing handfuls of the foodstuff, I caught hold of him and said, "I will surely take you to Allahs Messenger ﷺ as it is the third time you promise not to return, yet you break your promise and come." He said, "(Forgive me and) I will teach you some words with which Allah will benefit you." I asked, "What are they?" He replied, "Whenever you go to bed, recite "Ayat-al-Kursi"-- Allahu la ilaha illa huwa-l-Haiy-ul Qaiyum till you finish the whole verse. (If you do so), Allah will appoint a guard for you who will stay with you and no satan will come near you till morning. " So, I released him. In the morning, Allahs Apostle asked, "What did your prisoner do yesterday?" I replied, "He claimed that he would teach me some words by which Allah will benefit me, so I let him go." Allahs Messenger ﷺ asked, "What are they?" I replied, "He said to me, Whenever you go to bed, recite Ayat-al-Kursi from the beginning to the end ---- Allahu la ilaha illa huwa-lHaiy-ul-Qaiyum----. He further said to me, (If you do so), Allah will appoint a guard for you who will stay with you, and no satan will come near you till morning. (Abu Huraira or another sub-narrator) added that they (the companions) were very keen to do good deeds. The Prophet ﷺ said, "He really spoke the truth, although he is an absolute liar. Do you know whom you were talking to, these three nights, O Abu Huraira?" Abu Huraira said, "No." He said, "It was Satan."