(11) باب بَرَاءَةِ حَرَمِ النَّبِيِّ صلى الله عليه وسلم مِنَ الرِّيبَةِ
Anas reported that a person was charged with fornication with the slavegirl of Allah's Messenger (ﷺ). Thereupon Allah's Messenger (ﷺ) said to 'Ali:
Go and strike his neck. 'Ali came to him and he found him in a well making his body cool. 'Ali said to him: Come out, and as he took hold of his hand and brought him out, he found that his sexual organ had been cut. Hadrat 'Ali refrained from striking his neck. He came to Allah's Apostle (ﷺ) and said: Allah's Messenger, he has not even the sexual organ with him.
Reference: Sahih Muslim 2771
In-book reference: Book 50, Hadith 68
USC-MSA web (English) reference(deprecated numbering scheme): Book 37, Hadith 6676