It is narrated from Abu Huraira and Zaid bin Khalid (may Allah be pleased with them) that a man stated that his son had committed adultery with another man's wife. The Messenger of Allah (ﷺ) said: "I will judge between you according to the Book of Allah." Then he (ﷺ) ordered that his son be given one hundred lashes and exiled for one year. Then the Prophet (ﷺ) ordered Anas (may Allah be pleased with him) to go to the woman in the morning; if she confessed to adultery, then she should be stoned. When the woman confessed, Anas (may Allah be pleased with him) stoned her.
Hadith Referenceمسند الإمام الشافعي / كتاب الحدود / 1573
Hadith Takhrijاخرجه البخاري، الايمان والنذور، باب كيف كانت يمين النبي صلی اللہ علیہ وسلم (6633) ، (6634) ومسلم، الحدود، باب من اعترف على نفسه بالزنى (1697)، (1698)۔