Imam Ja’far as-Sadiq (a.s.) says in Rawdatul Kāfi that there was a hermit in Bani Israel. He was absolutely free from sins. Upon seeing this the head Satan called his cohorts and asked which one of them could mislead this man? One of them volunteered and Satan asked what method he would use? He said through women. The Satan told him that he would not succeed because the person was oblivious to sexual pleasure. Another Satan rose up and said he would deviate him through wine and sensuality.
The big Satan said that he too was unsuitable for this job because the sage was not interested in these things. A third Satan stood up and said that he would cause him to err through good deeds and noble character. The big Satan said that indeed he was fit for the job. This Satan, at once went to the place where the sage was engrossed in his meditation, and stood up beside him and began to pray Salāt. The worshipper was feeling sleepy but the Satan continued to perform prayers. When the worshipper got tired he would take a rest but the Satan did not take a break.
The worshipper felt himself inferior and went to the devil to ask him the secret of his stamina in praying. The junior devil did not give any reply and the worshipper reiterated his question. Yet there was no response from the devil. When the worshipper asked him the third time the devil said, “The fact is that I had committed a great sin and since then whenever I remember my sin, I get impetus to worship more.” The worshipper asked him what sin he had committed so that even he can do it and gain the stamina to worship so much. The devil said, “Go to a particular prostitute in the town, pay her two dirhams and fulfill your needs with her.” “From where can I get two dirhams?” asked the worshipper, “I don’t even know what a Dirham means”. The devil took out two dirhams from under his feet and gave them to the worshipper and also gave him his cloak and sent him towards the city.
The worshipper sought the address of the prostitute. The people guided him thinking that he was going to her to guide her towards morality. The worshipper gave the two dirhams to the woman and asked her to entertain him. The prostitute invited him inside with respect and said, “Pious people like you do not visit prostitutes. Why have you taken such a step?” The worshipper explained his aim in detail. The woman told him, “Actually, avoiding a sin is easier than repenting for it. Because it is not necessary that a sinner will get a chance to repent. I think that the one who has advised you for this is Satan, who has assumed a human form to mislead you. Go back to your place and you shall find him missing.”
The worshipper returned home and by chance the prostitute died the same night. In the morning people saw the following inscribed on her door: Take part in the funeral of this woman, She is from the people of Paradise. The people fell into doubt and were so astounded that for Three days they were not able to bury her. Till the Almighty Allah revealed upon His Messenger, Mūsa Ibn Imran (a.s.) to recite her funeral prayer and also command the people to participate in it. “Because she had prevented a servant of Mine from committing a grievous sin. So I have forgiven all her sins and made Paradise incumbent on her.”