Sayyiduna Zayd bin Khalid al-Juhani and Sayyiduna Abu Hurayrah (may Allah be pleased with them both) related that two men came to the Messenger of Allah (peace and blessings be upon him) for judgement. One of them said: O Messenger of Allah! Judge between us according to the Book of Allah, and permit me to speak. He said: "Speak." He said: O Messenger of Allah! My son was a hired worker for this man, and he committed adultery with his wife. I was told that stoning was due upon my son, so I ransomed him from it with a hundred sheep and a slave girl. Then I asked the people of knowledge, and they told me that upon my son are a hundred lashes and exile for a year, and that stoning is due upon his 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: your sheep and your slave girl are returned to you." The narrator said: And he had his son given a hundred lashes and exiled him for a year, and he ordered Unays al-Aslami to stone the other man's wife, so he stoned her.
Hadith Referenceالمعجم الكبير للطبراني / باب الزاي / 5177