Imam Sha’bi (may Allah have mercy on him) says that (Sharahah Hamdaniyah came to Sayyiduna Ali (may Allah be pleased with him) and said, “I have committed adultery, so give me the punishment.”) Sayyiduna Ali (may Allah be pleased with him) said: “It is possible that you were forced into this act? Perhaps he was your husband?” But she kept replying “No” to every question. So, after she gave birth, Sayyiduna Ali (may Allah be pleased with him) flogged her, and then carried out the punishment of stoning. Someone asked him, “You flogged her and also stoned her?” He replied, “I flogged her in the light of the Book of Allah, and I stoned her in the light of the Sunnah of the Messenger of Allah (peace and blessings be upon him).”
Hadith Referenceمسند احمد / مسند الخلفاء الراشدين / 1190
Hadith Gradingحکم دارالسلام:حديث صحيح ، وفي خ : 6812، وهو مختصر بقصة الرجم دون الجلد