Sahih Muslim , Book 39, Hadith 190 (In-Book) ⓘ
Abu as-Sa'ib, the freed slaved of Hisham b. Zuhra, said that he visited Abu Sa'id Khudri in his house, (and he further) said: I found him saying his prayer, so I sat down waiting for him to finish his prayer when I heard a stir in the bundles (of wood) lying in a comer of the house. I looked towards it and found a snake. I jumped up in order to kill it, but he (Abu Sa'id Khudri) made a gesture that I should sit down. So I sat down and as he finished (the prayer) he pointed to a room in the house and said: Do you see this room? I said: Yes. He said: There was a young man amongst us who had been newly wedded. We went with Allah's Messenger (to participate in the Battle) of Trench when a young man in the midday used to seek permission from Allah's Messenger to return to his family. One day he sought permission from him and Allah's Messenger (after granting him the permission) said to him: Carry your weapons with you for I fear the tribe of Quraiza (may harm you). The man carried the weapons and then came back and found his wife standing between the two doors. He bent towards her smitten by jealousy and made a dash towards her with a spear in order to stab her. She said: Keep your spear away and enter the house until you see that which has made me come out. He entered and found a big snake coiled on the bedding. He darted with the spear and pierced it and then went out having fixed it in the house, but the snake quivered and attacked him and no one knew which of them died first, the snake or the young man. We came to Allah's Apostle and made a mention to him and said: Supplicate to Allah that that (man) may be brought back to life. Thereupon he said: Ask forgiveness for your companion and then said: There are in Medina jinns who have accepted Islam, so when you see any one of them, pronounce a warning to it for three days, and if they appear before you after that, then kill it for that is a devil.
وَحَدَّثَنِي أَبُو الطَّاهِرِ، أَحْمَدُ بْنُ عَمْرِو بْنِ سَرْحٍ أَخْبَرَنَا عَبْدُ اللَّهِ بْنُ وَهْبٍ، أَخْبَرَنِي مَالِكُ بْنُ أَنَسٍ، عَنْ صَيْفِيٍّ، - وَهُوَ عِنْدَنَا مَوْلَى ابْنِ أَفْلَحَ - أَخْبَرَنِي أَبُو السَّائِبِ، مَوْلَى هِشَامِ بْنِ زُهْرَةَ أَنَّهُ دَخَلَ عَلَى أَبِي سَعِيدٍ الْخُدْرِيِّ فِي بَيْتِهِ قَالَ فَوَجَدْتُهُ يُصَلِّي فَجَلَسْتُ أَنْتَظِرُهُ حَتَّى يَقْضِيَ صَلاَتَهُ فَسَمِعْتُ تَحْرِيكًا فِي عَرَاجِينَ فِي نَاحِيَةِ الْبَيْتِ فَالْتَفَتُّ فَإِذَا حَيَّةٌ فَوَثَبْتُ لأَقْتُلَهَا فَأَشَارَ إِلَىَّ أَنِ اجْلِسْ . فَجَلَسْتُ فَلَمَّا انْصَرَفَ أَشَارَ إِلَى بَيْتٍ فِي الدَّارِ فَقَالَ أَتَرَى هَذَا الْبَيْتَ فَقُلْتُ نَعَمْ . قَالَ كَانَ فِيهِ فَتًى مِنَّا حَدِيثُ عَهْدٍ بِعُرْسٍ - قَالَ - فَخَرَجْنَا مَعَ رَسُولِ اللَّهِ صلى الله عليه وسلم إِلَى الْخَنْدَقِ فَكَانَ ذَلِكَ الْفَتَى يَسْتَأْذِنُ رَسُولَ اللَّهِ صلى الله عليه وسلم بِأَنْصَافِ النَّهَارِ فَيَرْجِعُ إِلَى أَهْلِهِ فَاسْتَأْذَنَهُ يَوْمًا فَقَالَ لَهُ رَسُولُ اللَّهِ صلى الله عليه وسلم " خُذْ عَلَيْكَ سِلاَحَكَ فَإِنِّي أَخْشَى عَلَيْكَ قُرَيْظَةَ " . فَأَخَذَ الرَّجُلُ سِلاَحَهُ ثُمَّ رَجَعَ فَإِذَا امْرَأَتُهُ بَيْنَ الْبَابَيْنِ قَائِمَةً فَأَهْوَى إِلَيْهَا الرُّمْحَ لِيَطْعُنَهَا بِهِ وَأَصَابَتْهُ غَيْرَةٌ فَقَالَتْ لَهُ اكْفُفْ عَلَيْكَ رُمْحَكَ وَادْخُلِ الْبَيْتَ حَتَّى تَنْظُرَ مَا الَّذِي أَخْرَجَنِي . فَدَخَلَ فَإِذَا بِحَيَّةٍ عَظِيمَةٍ مُنْطَوِيَةٍ عَلَى الْفِرَاشِ فَأَهْوَى إِلَيْهَا بِالرُّمْحِ فَانْتَظَمَهَا بِهِ ثُمَّ خَرَجَ فَرَكَزَهُ فِي الدَّارِ فَاضْطَرَبَتْ عَلَيْهِ فَمَا يُدْرَى أَيُّهُمَا كَانَ أَسْرَعَ مَوْتًا الْحَيَّةُ أَمِ الْفَتَى قَالَ فَجِئْنَا إِلَى رَسُولِ اللَّهِ صلى الله عليه وسلم فَذَكَرْنَا ذَلِكَ لَهُ وَقُلْنَا ادْعُ اللَّهَ يُحْيِيهِ لَنَا . فَقَالَ " اسْتَغْفِرُوا لِصَاحِبِكُمْ " . ثُمَّ قَالَ " إِنَّ بِالْمَدِينَةِ جِنًّا قَدْ أَسْلَمُوا فَإِذَا رَأَيْتُمْ مِنْهُمْ شَيْئًا فَآذِنُوهُ ثَلاَثَةَ أَيَّامٍ فَإِنْ بَدَا لَكُمْ بَعْدَ ذَلِكَ فَاقْتُلُوهُ فَإِنَّمَا هُوَ شَيْطَانٌ " .
also referenced under: Hadith 2236 (Reference) & Book 26, Hadith 5557 (USC-MSA)