It is narrated from Sayyiduna Sahl bin Sa'd (may Allah be pleased with him) that a young man of the Ansar was newly married. He went out with the Prophet (peace and blessings be upon him) on a military expedition, then came back from the road to see his family, and saw his wife standing in the room. He pointed his spear at her, and the woman said: Go inside and see what is in the house. He went in and saw a snake coiled up on his bed. He pierced it through with his spear, then planted the spear in the courtyard of the house. The snake writhed and jolted, and the man jolted too; then the snake died and the man died as well. This incident was mentioned to the Prophet (peace and blessings be upon him), and he (peace and blessings be upon him) said: "Some Muslim jinn have come to settle in Madinah," or he said: "These houses have some dwellers (jinn); when you see any of them, seek refuge (with Allah) from it, then if it comes back, kill it."
Hadith Referenceالمعجم الكبير للطبراني / باب السين / 5914