I went in to see Abu Saeed Khudri and found him praying, so I sat waiting until he finished his prayer. Then I heard a movement beneath a couch in his house, and there was a snake. I stood up to kill it, but Abu Saeed gestured for me to sit down. When he had finished, he pointed to a room in the house and asked, "Do you see this room?"I said, "Yes."He said, "There was once a young man living there, newly married. He went out with the Messenger of Allah ﷺ to the Battle of the Trench. While he was there, the young man came to him asking permission, saying, 'Messenger of Allah, give me leave to spend some time with my wife.'The Messenger of Allah ﷺ gave him permission and said, 'Take your weapon with you, for I fear what Banu Qurayzah might do to you.'The young man set off toward his wife and found her standing between the two doors. He thrust his spear toward her to stab her, for jealousy had overcome him.She said, 'Do not be hasty. Come in and see what is in your house.'He entered and found a snake coiled on his bed. He drove his spear into it, then went out and planted the spear in the courtyard. The snake writhed on the tip of the spear, and the young man fell down dead. It was not known which of them died first, the young man or the snake.We mentioned this to the Messenger of Allah ﷺ, and he said, "There are jinn in Madinah who have accepted Islam. If you see any of them, give it warning for three days. If it still appears after that, then kill it, for it is only a devil."In another wording, "These houses have inhabitants. If you see any of them, give it three warnings to leave. If it goes, fine, otherwise kill it, for it is a disbeliever."And he said to them, "Go and bury your companion."
دخلت على أبي سعيد الخدري، فوجدته يصلي، فجلست أنتظره حتى قضى صلاته، فسمعت تحريكا تحت سرير في بيته، فإذا حية، فقمت لأقتلها، فأشار إلي أبو سعيد أن اجلس، فلما انصرف، أشار إلى بيت في الدار، فقال: أترى هذا البيت؟ فقلت: نعم، فقال: إنه قد كان فيه فتى حديث عهد بعرس، فخرج مع رسول الله ﷺ إلى الخندق، فبينا هو به، إذ أتاه الفتى يستأذنه، فقال: يا رسول الله، ائذن لي أحدث بأهلي عهدا، فأذن له رسول الله ﷺ، وقال: خذ عليك سلاحك، فإني أخشى عليك بني قريظة فانطلق الفتى إلى أهله، فوجد امرأته قائمة بين البابين، فأهوى إليها بالرمح ليطعنها، وأدركته غيرة، فقالت: لا تعجل حتى تدخل وتنظر ما في بيتك، فدخل، فإذا هو بحية منطوية على فراشه، فركز فيها رمحه، ثم خرج بها، فنصبه في الدار، فاضطربت الحية في رأس الرمح، وخر الفتى ميتا فما يدرى أيهما كان أسرع موتا، الفتى أم الحية؟ فذكرنا ذلك لرسول الله ﷺ فقال: إن بالمدينة جنا قد أسلموا، فإذا رأيتم منهم شيئا، فآذنوه ثلاثة أيام فإن بدا لكم بعد ذلك، فاقتلوه، فإنما هو شيطان. وفي لفظ: إن لهذه البيوت عوامر، فإذا رأيتم شيئا منها فحرجوا عليها ثلاثا، فإن ذهب، وإلا فاقتلوه فإنه كافر وقال لهم: اذهبوا فادفنوا صاحبكم.
Malik narrated it in the chapter on Seeking Permission (33), from Sayfi, the freed slave of Ibn Aflah, from Abu Saaib, the freed slave of Hisham bin Zahra, that he said, then he narrated it as already mentioned.Muslim narrated it in the chapter on Greetings (2236:139) through the route of Ibn Wahb, from Malik, with the same wording, except that it contains, "So we came to the Messenger of Allah ﷺ and mentioned that to him, and we said, 'Call upon Allah to bring him back to life for us.' He said, 'Ask forgiveness for your companion.' Then he said, 'There are jinn in Madinah...'" the rest of the hadith.He also narrated it (140) through the route of Asma bin Ubayd, narrating from a man called Saaib, who according to us is Abu Saaib, he said, then he related the story, and it contains the second wording.