One day ‘Ali (a.s.) was sitting with his companions when a man approached and said “O Chief of the Believers, I have committed sodomy with a boy, please purify me (impose legal penalty upon me) ‘Ali (a.s.) told him, “Go home, you may have had some misunderstanding.”
The next day the man returned and repeated his confession and requested for penalty. ‘Ali (a.s.) said,
“Go home, you may not be in your sense right now.”
He went away only to return the third time and repeat his confession and again asked for punishment.
At last when he came for the fourth time, ‘Ali (a.s.) said,
“The Holy Prophet (S) has prescribed Three methods of dealing with the situation, you may choose any one of the three deaths – by having the arms and feet tied and thrown from the cliff, being beheaded or being burnt alive.”
He said, “O, ‘Ali (a.s.) which is the worst of these methods?” Imam replied, “Burning alive.” “Then I choose this death.” said the man. By permission of ‘Ali (a.s.), he stood and prayed two rakāt prayer and then said, “O Allah ! A sin was committed by me of which You are well aware. Then I had the fear of this sin, I came to the Successor of your Prophet and requested him to purify me. He gave me a choice of three deaths. I chose the most dreadful death. I pray to you to consider this penalty as the expiation of my sin and do not burn me in the fire of Hell which is ignited by you.”
Then he got up weeping and jumped into the pit into which the fire had been lit. He sat in the fire and the fire engulfed him from all the sides. ‘Ali (a.s.) began to weep, upon seeing this condition and the other companions were also in tears.
‘Ali (a.s.) said, “Arise, the one who has caused the angels of the earth and the sky to weep. Allah has certainly accepted your repentance. Get up but never approach the sin that you have committed.”
It so happened that the man came out of the fire unscathed. The fire could not burn the one who repented.