It is narrated from Sayyiduna Zayd bin Khalid and Sayyiduna Abu Hurayrah (may Allah be pleased with them both) that two men brought their dispute to the Messenger of Allah (peace and blessings be upon him). One of them said: I adjure you by Allah to judge between us only according to the Book of Allah. Then his opponent stood up and said: O Messenger of Allah! My son was an 'asif, that is, a hired worker, for this man, and he committed adultery with his wife, so I ransomed him from it with a hundred sheep and a servant. Then when I asked the people of knowledge, they told me that upon my son are a hundred lashes and exile for a year, while stoning is due upon this man's wife. The Messenger of Allah (peace and blessings be upon him) said: "By the One in whose hand is my soul! I shall judge between you two only according to the Book of Allah: the hundred sheep and the servant are returned to you, and upon your son are a hundred lashes and exile for a year. And O Unays! Go in the morning to this man's wife; if she confesses, stone her." So he asked her, and she confessed, and he stoned her.
Hadith Referenceالمعجم الكبير للطبراني / باب الزاي / 5180