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.
quran:9:12

And if they break their oaths after their treaty and defame your religion, then fight the leaders of disbelief, for indeed, there are no oaths ˹sacred˺ to them; ˹fight them that˺ they might cease.  

But if they break, ˹if˺ they violate, their oaths, their covenants, after ˹making˺ their pact and assail your religion, slander it, then fight the leaders of unbelief, its heads (here an overt noun ˹‘the leaders of unbelief’˺ has replaced the ˹third person˺ pronominalisation) — verily they have no ˹binding˺ oaths, ˹no˺ pacts (a variant reading ˹for aymān, ‘oaths’˺ has the kasra inflection ˹for the alif, sc. īmān, ‘˹no˺ faith’˺) — so that they might desist, from unbelief.
القرآن:٩:١٢

وَإِنْ نَكَثُوا أَيْمَانَهُمْ مِنْ بَعْدِ عَهْدِهِمْ وَطَعَنُوا فِي دِينِكُمْ فَقَاتِلُوا أَئِمَّةَ الْكُفْرِ ۙ إِنَّهُمْ لَا أَيْمَانَ لَهُمْ لَعَلَّهُمْ يَنْتَهُونَ  

{وإن نكثوا} نقضوا {أيمانهم} مواثيقهم {من بعد عهدهم وطعنوا في دينكم} عابوه {فقاتلوا أئمة الكفر} رؤساءه، فيه وضع الظاهر موضع المضمر {إنهم لا أيمان} عهود {لهم} وفي قراءة بالكسر {لعلهم ينتهون} عن الكفر.