Sayyiduna Jabir (may Allah be pleased with him) narrates this saying of the Prophet (peace and blessings be upon him): "I entered the house and there was a devil behind the door. I began to strangle him, until I felt the coolness of his tongue on my hand. Had it not been for the supplication of a righteous servant, he would have been tied up by the morning and people would have seen him."
Al-Tabarani recorded it, and its chain is hasan (good).