It is narrated from Sayyiduna Abdullah bin Adi bin al-Hamra' (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) was sitting among the people when a man came to him (peace and blessings be upon him) and asked his (peace and blessings be upon him) permission to speak to him (peace and blessings be upon him) in private about killing a hypocrite. The Prophet (peace and blessings be upon him) spoke aloud before everyone and asked: "Does he not bear witness that there is no true god except Allah?" He said: Indeed he does, O Messenger of Allah (peace and blessings be upon him)! But his testimony counts for nothing (it is mere show). He (peace and blessings be upon him) said: "Does he not bear witness that I am the Messenger of Allah?" He said: Indeed he does, O Messenger of Allah (peace and blessings be upon him)! But this testimony of his also counts for nothing. He (peace and blessings be upon him) asked: "Does he not pray?" He said: Indeed he does, but his prayer has no reality. At this he (peace and blessings be upon him) said: "These are the people whom I have been forbidden to kill."
All the narrators of this chain are narrators of the Sahih (Bukhari and Muslim).