Narrated Abu Huraira and Zaid bin Khalid
While we were with the Prophet (ﷺ), a man stood up and said (to the Prophet (ﷺ) ), "I beseech you by Allah, that you should judge us according to Allah's Laws." Then the man's opponent who was wiser than him, got up saying (to Allah's Messenger (ﷺ)) "Judge us according to Allah's Law and kindly allow me (to speak)." The Prophet (ﷺ) said, "'Speak." He said, "My son was a laborer working for this man and he committed an illegal sexual intercourse with his wife, and I gave one-hundred sheep and a slave as a ransom for my son's sin. Then I asked a learned man about this case and he informed me that my son should receive one hundred lashes and be exiled for one year, and the man's wife should be stoned to death." The Prophet (ﷺ) said, "By Him in Whose Hand my soul is, I will judge you according to the Laws of Allah. Your one-hundred sheep and the slave are to be returned to you, and your son has to receive one-hundred lashes and be exiled for one year. O Unais! Go to the wife of this man, and if she confesses, then stone her to death." Unais went to her and she confessed. He then stoned her to death.
Narrated Ibn `Abbas
`Umar said, "I am afraid that after a long time has passed, people may say, "We do not find the Verses of the Rajam (stoning to death) in the Holy Book," and consequently they may go astray by leaving an obligation that Allah has revealed. Lo! I confirm that the penalty of Rajam be inflicted on him who commits illegal sexual intercourse, if he is already married and the crime is proved by witnesses or pregnancy or confession." Sufyan added, "I have memorized this narration in this way." `Umar added, "Surely Allah's Messenger (ﷺ) carried out the penalty of Rajam, and so did we after him."