‘Ubada b. as-Samit reported the Prophet as saying, “Receive my teaching, receive my teaching God has appointed a way for those women (Cf. Al-Qur'an, 4:15). When the parties are unmarried they shall receive a hundred lashes and be banished for a year when they commit fornication and when they have been married they shall receive a hundred lashes and be stoned to death.”
God sent Muhammad with the truth and sent down the Book to him, and the verse of stoning was included in what God most high sent down. God's Messenger had people stoned to death and we have done it also since his death. Stoning is a duty laid down in God’s Book for married men and women who commit fornication when proof is established, or if there is pregnancy, or a confession.
‘Abdallah b. ‘Umar told that the Jews came to God’s Messenger and mentioned to him that a man and a woman of their number had committed fornication. He asked them what they found in the Torah about stoning and they replied that they should disgrace them and that they should be beaten. ‘Abdallah b. Salam then said, “You lie; it contains instruction that they should be stoned to death, so bring the Torah.” They spread it out, and one of them put his hand over the verse of stoning and read what preceded it and what followed it. 'Abdallah b. Salam told him to lift his hand and when he did so the verse of stoning was seen to be in it. They then said, “He has spoken the truth, Muhammad; the verse of stoning is in it.” The Prophet then gave command regarding them and they were stoned to death. In a version it says that he told him to lift his hand and that when he did so the verse of stoning was clearly in it. The man then said, “It contains the verse of stoning, Muhammad, but we have been concealing it from one another.” He then gave command regarding them and they were stoned to death.
Zaid b. Khalid told that he heard God’s Messenger giving command that an unmarried man who committed fornication should receive a hundred lashes and be banished for a year.