Sahih Muslim , Book 16, Hadith 4154 (USC-MSA) ⓘ
'Abdullah (b. Mas'ud) reported: Allah's Messenger stood up and said: By Him besides Whom there is no god but He, the blood of a Muslim who bears the testimony that there is no god but Allah, and I am His Messenger, may be lawfully shed only in case of three persons: the one who abandons Islam, and deserts the community [Ahmad, one of the narrators, is doubtful whether the Prophet used the word li'l-jama'ah or al-jama'ah), and the married adulterer, and life for life.
حَدَّثَنَا أَحْمَدُ بْنُ حَنْبَلٍ، وَمُحَمَّدُ بْنُ الْمُثَنَّى، - وَاللَّفْظُ لأَحْمَدَ - قَالاَ حَدَّثَنَا عَبْدُ الرَّحْمَنِ، بْنُ مَهْدِيٍّ عَنْ سُفْيَانَ، عَنِ الأَعْمَشِ، عَنْ عَبْدِ اللَّهِ بْنِ مُرَّةَ، عَنْ مَسْرُوقٍ، عَنْ عَبْدِ اللَّهِ، قَالَ قَامَ فِينَا رَسُولُ اللَّهِ صلى الله عليه وسلم فَقَالَ " وَالَّذِي لاَ إِلَهَ غَيْرُهُ لاَ يَحِلُّ دَمُ رَجُلٍ مُسْلِمٍ يَشْهَدُ أَنْ لاَ إِلَهَ إِلاَّ اللَّهُ وَأَنِّي رَسُولُ اللَّهِ إِلاَّ ثَلاَثَةُ نَفَرٍ التَّارِكُ الإِسْلاَمَ الْمُفَارِقُ لِلْجَمَاعَةِ أَوِ الْجَمَاعَةَ - شَكَّ فِيهِ أَحْمَدُ - وَالثَّيِّبُ الزَّانِي وَالنَّفْسُ بِالنَّفْسِ " . قَالَ الأَعْمَشُ فَحَدَّثْتُ بِهِ، إِبْرَاهِيمَ فَحَدَّثَنِي عَنِ الأَسْوَدِ، عَنْ عَائِشَةَ، بِمِثْلِهِ .
also referenced under: Book 28, Hadith 36 (In-Book) & Hadith 1676 (Reference)