Abu Hurairah and Zayd bin Khalid reported,

Two men came to the Messenger of Allah ﷺ with a dispute. One of them said, "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 Jariya of mine. Then I asked the people of knowledge, and they informed me that my son is to receive a hundred lashes and be banished for a year, and that stoning applies only to the man's wife."The Messenger of Allah ﷺ said, "By the One in whose hand is my soul, I will judge between you by the Book of Allah. As for your sheep and your Jariya, they are to be returned to you."He then had the son given a hundred lashes and banished him for a year, and he ordered Unays to go to the other man's wife, saying, "If she confesses, stone her." She confessed, and he stoned her.

Nasai 5412

Sahih

أخبرنا محمد بن سلمة قال أنبأنا عبد الرحمن بن القاسم عن مالك عن ابن شهاب عن عبيد الله بن عبد الله بن عتبة

عن أبي هريرة وزيد بن خالد الجهني أنهما أخبراه

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

النسائي 5412صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Nasai Sughra
Book
Etiquette of judges
Chapter
Protecting women from the court of judgment
Numbering
Darussalam 5412
Nasai 5412