أَخْبَرَنَا أَبُو عَبْدِ اللَّهِ الْحَافِظُ ، أَخْبَرَنَا أَبُو عَبْدِ اللَّهِ مُحَمَّدُ بْنُ عَلِيٍّ الصَّنْعَانِيُّ ، حَدَّثَنَا إِسْحَاقُ بْنُ إِبْرَاهِيمَ ، أَخْبَرَنَا عَبْدُ الرَّزَّاقِ ، عَنْ مَعْمَرٍ ، عَنْ قَتَادَةَ ، عَنْ أَبِي رَافِعٍ ، أَنَّ خَالِدَ بْنَ الْوَلِيدِ جَاءَ إِلَى النَّبِيِّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ فَشَكَا إِلَيْهِ وَحْشَةً يَجِدُهَا ، فَقَالَ لَهُ : " أَلَا أُعَلِّمُكَ مَا عَلَّمَنِي الرُّوحُ الْأَمِينُ جِبْرِيلُ عَلَيْهِ السَّلَامُ ؟ قَالَ : " إِنَّ عِفْرِيتًا مِنَ الْجِنِّ يَكِيدُكَ ، فَإِذَا أَوَيْتَ إِلَى فِرَاشِكَ فَقُلْ : أَعُوذُ بِكَلِمَاتِ اللَّهِ التَّامَّاتِ الَّتِي لَا يُجَاوِزُهُنَّ بَرٌّ وَلَا فَاجِرٌ مِنْ شَرِّ مَا يَنْزِلُ مِنَ السَّمَاءِ وَمَا يَعْرُجُ فِيهَا ، وَمِنْ شَرِّ مَا ذَرَأَ فِي الْأَرْضِ وَمِنْ شَرِّ مَا يَخْرُجُ مِنْهَا وَمِنْ شَرِّ طَوَارِقِ اللَّيْلِ وَالنَّهَارِ ، وَمِنْ شَرِّ كُلِّ طَارِقٍ يَطْرُقُ إِلَّا بِخَيْرٍ يَا رَحْمَنُ "
Sayyiduna Khalid bin al-Walid (may Allah be pleased with him) came to the Prophet (peace and blessings be upon him) and complained to him of an anxiety and loneliness that he felt. So he (peace and blessings be upon him) said to him: "Shall I not teach you the words that the Trustworthy Spirit, Jibril (peace be upon him), taught me?" Then he said: "Indeed, a rebellious one from among the jinn is plotting against you. So when you come to your bed, say: 'I seek refuge in the perfect words of Allah, which neither the righteous nor the wicked can surpass, from the evil of what descends from the sky and what ascends into it, from the evil of what He has spread in the earth and what comes out of it, from the evil of the sudden calamities of night and day, and from the evil of every visitor that comes by night, except one that comes with good, O Most Merciful.'"