Sahih al-Bukhari 6835, 6836
Limits and Punishments set by Allah (Hudood)
To carry out the legal punishment in the absence of the ruler
Narrated Abu Huraira and Zaid bin Khalid: A bedouin came to the Prophet (ﷺ) while he (the Prophet) was sitting, and said, "O Allah's Messenger (ﷺ) ! Give your verdict according to Allah's Laws (in our case)." Then his opponent got up and said, "He has told the truth, O Allah's Messenger (ﷺ) ! Decide his case according to Allah's Laws. My son was a laborer working for this person, and he committed illegal sexual intercourse with his wife, and the people told me that my son should be stoned to death, but I offered one-hundred sheep and a slave girl as a ransom for him. Then I asked the religious learned people, and they told me that my son should be flogged with one-hundred stripes and be exiled for one year." The Prophet (ﷺ) said, "By Him in Whose Hand my soul is, I will judge you according to Allah's Laws. The sheep and the slave girl will be returned to you and your son will be flogged one-hundred stripes and be exiled for one year. And you, O Unais! Go to the wife of this man (and if she confesses), stone her to death." So Unais went in the morning and stoned her to death (after she had confessed).