Ikrima reported,

Ali رضي الله عنه was brought a group of these heretics who had books with them. He ordered a fire to be kindled, and once it was blazing, he burned them along with their books.Ikrima said, "When this reached Ibn Abbas, he said, 'Had it been me, I would not have burned them, because of the prohibition of the Messenger of Allah ﷺ. But I would have killed them, because of the saying of the Messenger of Allah ﷺ, "Whoever changes his religion, kill him." And the Messenger of Allah ﷺ said, "Do not punish with the punishment of Allah عز وجل."'"

Ahmad 2551

Sahih

حدثنا عفان حدثنا حماد بن زيد حدثنا أيوب

عن عكرمة

أن عليا رضي الله عنه أتي بقوم من هؤلاء الزنادقة ومعهم كتب فأمر بنار فأججت ثم أحرقهم وكتبهم قال عكرمة فبلغ ذلك ابن عباس فقال لو كنت أنا لم أحرقهم لنهي رسول الله ﷺ ولقتلتهم لقول رسول الله ﷺ من بدل دينه فاقتلوه وقال رسول الله ﷺ لا تعذبوا بعذاب الله عز وجل

أحمد 2551صحيح
Contents
Reference
Commentary
Ayat
Collection
Musnad Ahmad
Book
Abdullah bin Abbas bin Abdul-Muttalib
Numbering
Darussalam 2551
Ahmad 2551