Abu Hurairah reported,

Zayd bin Khalid al-Juhani informed him that two men brought a dispute before the Messenger of Allah ﷺ. One of them said, "Messenger of Allah, judge between us by the Book of Allah."The other, who was the more knowledgeable of the two, said, "Yes, Messenger of Allah, judge between us by the Book of Allah, and grant me permission to speak."The Prophet ﷺ said, "Speak."He said, "My son was a hired worker for this man, and he committed adultery with his wife. I was told that my son must be stoned, so I ransomed him with a hundred sheep and a slave girl of mine. Then I asked the people of knowledge, and they informed me that what is due upon my son is a hundred lashes and exile for a year, and that stoning is due upon his wife."The Messenger of Allah ﷺ said, "By the One in whose hand is my soul, I shall judge between you by the Book of Allah. As for your sheep and your slave girl, they are returned to you."He then had the man's son flogged a hundred lashes and exiled him for a year, and he ordered Unays al-Aslami to go to the other man's wife, saying, "If she confesses, then stone her." She confessed, and he stoned her.

Azami 12837

Sahih

عن أبي هريرة

وزيد بن خالد الجهني، أنهما أخبراه أن رجلين اختصما إلى رسول الله ﷺ، فقال أحدهما: يا رسول الله! اقض بيننا بكتاب الله، وقال الآخر- وهو أفقههما-: أجل، يا رسول الله! فاقض بيننا بكتاب الله، وائذن لي في أن أتكلم، قال: تكلم، فقال: إن ابني كان عسيفا على هذا، فزني بامرأته، فأخبروني: أن على ابني الرجم، فافتديت منه بمائة شاة وبجارية لي. ثم إني سألت أهل العلم فأخبروني: أن ما على ابني جلد مائة وتغريب عام، وأخبروني وإنما الرجم على امرأته، فقال رسول الله ﷺ: أما والذي نفسي بيده، لأقضين بينكما بكتاب الله، أما غنمك وجاريتك فرد عليك. وجلد ابنه مائة، وغربه عاما، وأمر أنيسا الأسلمي أن يأتي امرأة الآخر، فإن اعترفت، فارجمها، فاعترفت فرجمها.

الأعظمي 12837صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Tafsir of the great Quran
Chapter
Tafsir of Surah Nur, which is Madinan, and the number of its verses
Section
His saying, "The fornicatress and the fornicator, flog each one of them with a hundred lashes, and let not pity for them withhold you from the religion of Allah if you believe in Allah and the Last Day. And let a group of the believers witness their punishment." This ruling applies to the unmarried fornicator and fornicatress, while for the previously married, the Sunnah indicates that the punishment is stoning as mentioned in the authentic hadith
Numbering
Jami al-Kamil 12837 (2nd edition)
Azami 12837