Abu Hurairah, Zayd bin Khalid, and Shibl reported,

We were with the Prophet ﷺ when a man stood up before him and said, "I urge you by Allah, judge between us by the Book of Allah."His opponent then stood up, and he was more knowledgeable than the first, and said, "He has spoken the truth. 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 committed adultery with his wife. I paid him a ransom of one hundred sheep and a servant on my son's behalf. It seems he had been told that my son was liable to be stoned, so I ransomed him with that. Then I asked Some men of knowledge, and they informed me that my son was liable to one hundred lashes and exile for one year."The Messenger of Allah ﷺ said to him, "By the One in whose hand is my soul, I will judge between you by the Book of Allah عز وجل. As for the one hundred sheep and the servant, they are returned to you. Your son is liable to one hundred lashes and exile for one year. Go in the morning, Unays, to this man's wife, and if she confesses, then stone her."So he went to her in the morning, she confessed, and he stoned her.

Nasai 5413

Sahih

أخبرنا قتيبة قال حدثنا سفيان عن الزهري عن عبيد الله بن عبد الله

عن أبي هريرة وزيد بن خالد وشبل قالوا

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

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