A’isha reported God’s Messenger as saying, “The blood of a Muslim man who testifies that there is no god but God and that Muhammad is God’s Messenger may lawfully be shed only for one of three reasons:
fornication after marriage, in which case he should be stoned; one who goes forth to fight with God and His Messenger,* in which case he should be killed, or crucified, or made a fugitive; or one which commits murder for which he is killed.”
Abu Dawud transmitted it.
* Mirqat iv. 53 refers this to such things as highway robbery.