The Messenger of Allah ﷺ said, "Whoever changes his religion, kill him."
قال رسول الله ﷺ: من بدل دينه فاقتلوه.
No references are available.
Narrated by Nasai (4065) and Ahmad (2966), and graded sahih by Ibn Hibban (4475) and Bayhaqi (8/202), all of them through the route of Abdul-Samad bin Abdul-Warith, who said, Hisham bin Abu Abdullah narrated to us, from Qatada, from Anas, that Ali was brought some people from the Zutt who were worshipping an idol, so he burned them. Ibn Abbas then spoke, and he mentioned the hadith. Its chain of transmission is sahih.As for his saying, "the Zutt," it is with a dammah on the zay and a shaddah on the ta. They are a people from among the Sudanese and the Indians.As for his saying, "worshipping an idol," this means after they had already become Muslims.As for his saying, "he burned them," this was based on his own opinion and independent judgment. That is why, when the hadith of Ibn Abbas reached him, he approved of it and reverted to it.