صحيح البخاري Sahih Bukhari كتاب المحاربين The Book of Al-Maharbeen
بَابُ لاَ يُرْجَمُ الْمَجْنُونُ وَالْمَجْنُونَةُ:

(22) Chapter. An insane male or female should not be stoned to death.

2 hadith
Hadith 6815
حَدَّثَنَا يَحْيَى بْنُ بُكَيْرٍ ، حَدَّثَنَا اللَّيْثُ ، عَنْ عُقَيْلٍ ، عَنْ ابْنِ شِهَابٍ ، عَنْ أَبِي سَلَمَةَ ، وَسَعِيدِ بْنِ الْمُسَيِّبِ ، عَنْ أَبِي هُرَيْرَةَ رَضِيَ اللَّهُ عَنْهُ ، قَالَ : أَتَى رَجُلٌ رَسُولَ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ وَهُوَ فِي الْمَسْجِدِ فَنَادَاهُ ، فَقَالَ يَا رَسُولَ اللَّهِ : إِنِّي زَنَيْتُ ، فَأَعْرَضَ عَنْهُ ، حَتَّى رَدَّدَ عَلَيْهِ أَرْبَعَ مَرَّاتٍ ، فَلَمَّا شَهِدَ عَلَى نَفْسِهِ أَرْبَعَ شَهَادَاتٍ ، دَعَاهُ النَّبِيُّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ ، فَقَالَ : أَبِكَ جُنُونٌ ؟ قَالَ : لَا ، قَالَ : فَهَلْ أَحْصَنْتَ ؟ قَالَ : نَعَمْ ، فَقَالَ النَّبِيُّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ : اذْهَبُوا بِهِ فَارْجُمُوهُ ؟ "
Narrated Abu Huraira: A man came to Allah's Apostle while he was in the mosque, and he called him, saying, "O Allah's Apostle! I have committed illegal sexual intercourse.'" The Prophet turned his face to the other side, but that man repeated his statement four times, and after he bore witness against himself four times, the Prophet called him, saying, "Are you mad?" The man said, "No." The Prophet said, "Are you married?" The man said, "Yes." Then the Prophet said, 'Take him away and stone him to death."
Hadith Reference Sahih Bukhari / The Book of Al-Maharbeen / Hadith: 6815
Hadith Grading محدثین: أحاديث صحيح البخاريّ كلّها صحيحة
Hadith 6816
قَالَ ابْنُ شِهَابٍ : فَأَخْبَرَنِي مَنْ سَمِعَ جَابِرَ بْنَ عَبْدِ اللَّهِ ، قَالَ : فَكُنْتُ فِيمَنْ رَجَمَهُ ، فَرَجَمْنَاهُ بِالْمُصَلَّى ، فَلَمَّا أَذْلَقَتْهُ الْحِجَارَةُ هَرَبَ ، فَأَدْرَكْنَاهُ بِالْحَرَّةِ ، فَرَجَمْنَاهُ .
Jabir bin `Abdullah said: I was among the ones who participated in stoning him and we stoned him at the Musalla. When the stones troubled him, he fled, but we over took him at Al-Harra and stoned him to death.
Hadith Reference Sahih Bukhari / The Book of Al-Maharbeen / Hadith: 6816
Hadith Grading محدثین: أحاديث صحيح البخاريّ كلّها صحيحة