Ikrima reported,

Some apostates were brought to Ali رضي الله عنه, and he had them burned. When Ibn Abbas heard of this, he said, "Had it been me, I would not have burned them, because the Messenger of Allah ﷺ forbade it, saying, 'Do not punish with the punishment of Allah.' But I would have killed them, in accordance with the Messenger of Allah's ﷺ words, 'Whoever changes his religion, kill him.'"

Azami 7032

Sahih

عن عكرمة، قال

أتي علي رضي الله عنه بزنادقة فأحرقهم، فبلغ ذلك ابن عباس فقال: لو كنت أنا لم أحرقهم، لنهي رسول الله ﷺ: لا تعذبوا بعذاب الله ولقتلتهم لقول رسول الله ﷺ: من بدل دينه فاقتلوه.

الأعظمي 7032صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Apostate, those who wage war, and whoever insults the Messenger
Section
Ruling on the male apostate and female apostate and seeking their repentance
Numbering
Jami al-Kamil 7032 (2nd edition)
Azami 7032