Sayyiduna Abdullah bin Mas'ud (may Allah be pleased with him) narrates: The Noble Prophet (peace and blessings be upon him) said: "It is not permissible to shed the blood of a person who testifies that there is no deity except Allah and that I am the Messenger of Allah, except in three cases: a married adulterer, a life for a life, and a person who abandons his religion (i.e., Islam) and separates from the community (i.e., such a person is to be killed)."
Hadith Referenceصحیح ابن حبان / كتاب الحدود / 4408
Hadith Gradingفضيلة الشيخ الإمام محمد ناصر الدين الألبانيصحيح - «الإرواء» (7/ 253 - 255/ 2196): ق.فضيلة الشيخ العلّامة شُعيب الأرناؤوطإسناده صحيح على شرطهما