Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
bayhaqi:18062Abū ʿAmr Muḥammad b. ʿAbdullāh al-Bisṭāmī > Abū Bakr al-Ismāʿīlī > Ibrāhīm b. Hāshim al-Baghawī > Muḥammad b. ʿAbbād > Sufyān > Raʾayt ʿAmr b. Dīnār And ʾAyyūb Waʿammār al-Duhnī Ājtamaʿūā Fatadhākarūā al--Adhīn Ḥaraqahum ʿAlī Faḥaddath Ayyūb > ʿIkrimah > Ibn ʿAbbās > Balaghah

[Machine] "If I were they, I would not have burned them, because of the saying of the Messenger of Allah ﷺ : 'Do not punish people with the punishment of Allah.' And I would have killed them, because of the saying of the Messenger of Allah ﷺ : 'Whoever changes his religion, then kill him.' Ammar said: 'He did not burn them, but he dug trenches for them and connected them to each other, then he kindled fires over them until they died.' Amr said: 'The poet said: 'Throw at me wherever you want, if you don't throw at me in the two trenches when they kindle the fire there, then death is certain, except for the religion.'"

Note: The translation may not be entirely accurate as it is based on the given information.  

البيهقي:١٨٠٦٢أَخْبَرَنَا أَبُو عَمْرٍو مُحَمَّدُ بْنُ عَبْدِ اللهِ الْبِسْطَامِيُّ أنبأ أَبُو بَكْرٍ الْإِسْمَاعِيلِيُّ ثنا إِبْرَاهِيمُ بْنُ هَاشِمٍ الْبَغَوِيُّ ثنا مُحَمَّدُ بْنُ عَبَّادٍ ثنا سُفْيَانُ قَالَ رَأَيْتُ عَمْرَو بْنَ دِينَارٍ وَأَيُّوبَ وَعَمَّارًا الدُّهْنِيَّ اجْتَمَعُوا فَتَذَاكَرُوا الَّذِينَ حَرَقَهُمْ عَلِيٌّ ؓ فَحَدَّثَ أَيُّوبُ عَنْ عِكْرِمَةَ عَنِ ابْنِ عَبَّاسٍ ؓ أَنَّهُ بَلَغَهُ قَالَ

لَوْ كُنْتُ أَنَا مَا حَرَقْتُهُمْ؛ لِقَوْلِ رَسُولِ اللهِ ﷺ لَا تُعَذِّبُوا بِعَذَابِ اللهِ وَلَقَتَلْتُهُمْ لِقَوْلِ رَسُولِ اللهِ ﷺ مَنْ بَدَّلَ دِينَهُ فَاقْتُلُوهُ فَقَالَ عَمَّارٌ لَمْ يَحْرِقْهُمْ وَلَكِنْ حَفَرَ لَهُمْ حَفَائِرَ وَخَرَقَ بَعْضَهَا إِلَى بَعْضٍ ثُمَّ دَخَّنَ عَلَيْهِمْ حَتَّى مَاتُوا فَقَالَ عَمْرٌو قَالَ الشَّاعِرُ [البحر الوافر] لِتَرْمِ بِيَ الْمَنَايَا حَيْثُ شَاءَتْ إِذَا لَمْ تَرْمِ بِي فِي الْحُفْرَتَيْنِ إِذَا مَا أَجَّجُوا حَطَبًا وَنَارًا هُنَاكَ الْمَوْتُ نَقْدًا غَيْرَ دَيْنِ  

رَوَاهُ الْبُخَارِيُّ فِي الصَّحِيحِ عَنْ عَلِيِّ بْنِ عَبْدِ اللهِ عَنْ سُفْيَانَ دُونَ قَوْلِ عَمَّارٍ وَعَمْرٍو