Five persons, who had committed fornication, were brought before Umar, who ordered them to be subjected to the legal punishment for the crime. At that moment the Commander of the Faithfuls (a.s) arrived and said: “O’ Umar! Allah’s ruling in their case is not as you have ruled!” Umar requested: “You issue the ruling for them and implement the legal punishment.”
The Imam (a.s) beheaded the first person, stoned the second, subjected the third to the full punishment of eighty lashes, the fourth to half the punishment and ordered the discretionary punishment for the fifth!
Umar was amazed and the people astounded over the Imam’s (a.s) ruling. Umar asked him: “O’ Abul Hasan! Five persons were involved in one crime and you have issued different rulings for all of them?”
the Commander of the Faithfuls(a.s) explained: “The first person was a dhimmi,4) who had transgressed (the honour of) a Muslim woman and so had fallen out of the dhimmah5) – as such, his punishment could only be death.
The second person who had committed fornication possessed a spouse and so I had him stoned. The third one to have been involved in the crime did not have a wife and so I punished him with eighty lashes.
The fourth was a slave and therefore I subjected him to half the legal punishment (of eighty lashes), while the fifth one was poor of intellect due to which I subjected him to the discretionary punishment (some lashes).”
Hearing the explanation Umar exclaimed: “O’ Abul Hasan! May it never happen that I have to live with the people when you are not around (to help me)!”( Qadhawat-ha-e-Muhayyir al-’Uqul, pg. 45; Dastan-ha-e-Zindagi-e-’Ali , pg. 145 )