Musnad Ahmad 1190
It was narrated from ash-Shaʼbi that ‘Ali (رضي الله عنه) said to Sharahah:
Perhaps you were forced? Perhaps your husband came to you? Perhaps... perhaps...? She said: No. He said: When she gave birth to what was in her womb, he flogged her then he stoned her. It was said to him: You flogged her then you stoned her? He said: l flogged her in accordance with the Book of Allah and I stoned her in accordance with the Sunnah of the Messenger of Allah (ﷺ).
حَدَّثَنَا بَهْزٌ، حَدَّثَنَا حَمَّادُ بْنُ سَلَمَةَ، أَنْبَأَنَا سَلَمَةُ بْنُ كُهَيْلٍ، عَنِ الشَّعْبِيِّ، أَنَّ عَلِيًّا، رَضِيَ اللَّهُ عَنْهُ قَالَ لِشَرَاحَةَ لَعَلَّكِ اسْتُكْرِهْتِ لَعَلَّ زَوْجَكِ أَتَاكِ لَعَلَّكِ لَعَلَّكِ قَالَتْ لَا قَالَ فَلَمَّا وَضَعَتْ مَا فِي بَطْنِهَا جَلَدَهَا ثُمَّ رَجَمَهَا فَقِيلَ لَهُ جَلَدْتَهَا ثُمَّ رَجَمْتَهَا قَالَ جَلَدْتُهَا بِكِتَابِ اللَّهِ وَرَجَمْتُهَا بِسُنَّةِ رَسُولِ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ‏.‏