Language:
كتاب استتابة المرتدين والمعاندين وقتالهم
88  
Apostates
(2)
Chapter: Al-Murtad and Al-Murtaddah
(2)
باب حُكْمِ الْمُرْتَدِّ وَالْمُرْتَدَّةِ
Sahih al-Bukhari 6922

Narrated `Ikrima:

Some Zanadiqa (atheists) were brought to `Ali and he burnt them. The news of this event, reached Ibn `Abbas who said, "If I had been in his place, I would not have burnt them, as Allah's Messenger (ﷺ) forbade it, saying, 'Do not punish anybody with Allah's punishment (fire).' I would have killed them according to the statement of Allah's Messenger (ﷺ), 'Whoever changed his Islamic religion, then kill him.'"

حَدَّثَنَا أَبُو النُّعْمَانِ، مُحَمَّدُ بْنُ الْفَضْلِ حَدَّثَنَا حَمَّادُ بْنُ زَيْدٍ، عَنْ أَيُّوبَ، عَنْ عِكْرِمَةَ، قَالَ أُتِيَ عَلِيٌّ ـ رضى الله عنه ـ بِزَنَادِقَةٍ فَأَحْرَقَهُمْ فَبَلَغَ ذَلِكَ ابْنَ عَبَّاسٍ فَقَالَ لَوْ كُنْتُ أَنَا لَمْ أُحْرِقْهُمْ لِنَهْىِ رَسُولِ اللَّهِ صلى الله عليه وسلم وَلَقَتَلْتُهُمْ لِقَوْلِ رَسُولِ اللَّهِ صلى الله عليه وسلم ‏ "‏ مَنْ بَدَّلَ دِينَهُ فَاقْتُلُوهُ ‏"‏‏.‏
Reference : Sahih al-Bukhari 6922
In-book reference : Book 88, Hadith 5
USC-MSA web (English) reference : Vol. 9, Book 84, Hadith 57
  (deprecated numbering scheme)