Sunan Abi Dawud, Hadith 4402

Narrated Ali ibn AbuTalib: AbuZubyan said: A woman who had committed adultery was brought to Umar. He gave orders that she should be stoned. Ali passed by just then. He seized her and let her go. Umar was informed of it. He said: Ask Ali to come to me. Ali came to him and said: Commander of the Faithful, you know that the Messenger of Allah said: There are three (people) whose actions are not recorded: A boy till he reaches puberty, a sleeper till he awakes, a lunatic till he is restored to reason. This is an idiot (mad) woman belonging to the family of so and so. Someone might have done this action with her when she suffered the fit of lunacy. Umar said: I do not know. Ali said: I do not know.

حَدَّثَنَا هَنَّادٌ، عَنْ أَبِي الأَحْوَصِ، ح وَحَدَّثَنَا عُثْمَانُ بْنُ أَبِي شَيْبَةَ، حَدَّثَنَا جَرِيرٌ، - الْمَعْنَى - عَنْ عَطَاءِ بْنِ السَّائِبِ، عَنْ أَبِي ظَبْيَانَ، - قَالَ هَنَّادٌ - الْجَنْبِيِّ قَالَ أُتِيَ عُمَرُ بِامْرَأَةٍ قَدْ فَجَرَتْ فَأَمَرَ بِرَجْمِهَا فَمَرَّ عَلِيٌّ رضى الله عنه فَأَخَذَهَا فَخَلَّى سَبِيلَهَا فَأُخْبِرَ عُمَرُ قَالَ ادْعُوا لِي عَلِيًّا ‏.‏ فَجَاءَ عَلِيٌّ رضى الله عنه فَقَالَ يَا أَمِيرَ الْمُؤْمِنِينَ لَقَدْ عَلِمْتَ أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم قَالَ ‏ "‏ رُفِعَ الْقَلَمُ عَنْ ثَلاَثَةٍ عَنِ الصَّبِيِّ حَتَّى يَبْلُغَ وَعَنِ النَّائِمِ حَتَّى يَسْتَيْقِظَ وَعَنِ الْمَعْتُوهِ حَتَّى يَبْرَأَ ‏" ‏ ‏.‏ وَإِنَّ هَذِهِ مَعْتُوهَةُ بَنِي فُلاَنٍ لَعَلَّ الَّذِي أَتَاهَا أَتَاهَا وَهِيَ فِي بَلاَئِهَا ‏.‏ قَالَ فَقَالَ عُمَرُ لاَ أَدْرِي ‏.‏ فَقَالَ عَلِيٌّ عَلَيْهِ السَّلاَمُ وَأَنَا لاَ أَدْرِي ‏.‏

sunnah.com