Muwatta Malik, Book 9, Hadith 87 (USC-MSA)

Yahya related to me from Malik from Ibn Shihab from Ata ibn Yazid al-Laythi that Ubaydullah ibn Adi ibnal-Khiyar said, "Once when the Messenger of Allah, may Allah bless him and grant him peace, was sitting with some people, a man came to him and spoke secretly to him. Nobody knew what he had said until the Messenger of Allah, may Allah bless him and grant him peace, disclosed that he had asked for permission to kill one of the hypocrites. When he disclosed this, the Messenger of Allah, may Allah bless him and grant him peace, said, 'Doesn't he testify that there is no god but Allah and that Muhammad is the Messenger of Allah?' The man replied, 'Of course, but he hasn't really done so.' He said, 'Doesn't he do the prayer?' and the man replied, 'Of course, but he doesn't really do the prayer.' He said, may Allah bless him and grant him peace, 'Those are the ones whom Allah has forbidden me (to kill).' "

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

sunnah.com

also referenced under: Book 9, Hadith 418 (In-Book)