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:4

Excepted are those with whom you made a treaty among the polytheists and then they have not been deficient toward you in anything or supported anyone against you; so complete for them their treaty until their term ˹has ended˺. Indeed, Allah loves the righteous ˹who fear Him˺.  

Excepting those of the idolaters with whom you have made a pact, and who have not diminished ˹their commitment to˺ you in anyway, with regard to the terms of the pact, nor supported, assisted, anyone, from among the disbelievers, against you; ˹as for these˺ fulfil your pact with them until, the completion of, the term, to which you have agreed. Truly God loves those who fear ˹Him˺, by fulfilling pacts.
القرآن:٩:٤

إِلَّا الَّذِينَ عَاهَدْتُمْ مِنَ الْمُشْرِكِينَ ثُمَّ لَمْ يَنْقُصُوكُمْ شَيْئًا وَلَمْ يُظَاهِرُوا عَلَيْكُمْ أَحَدًا فَأَتِمُّوا إِلَيْهِمْ عَهْدَهُمْ إِلَىٰ مُدَّتِهِمْ ۚ إِنَّ اللَّهَ يُحِبُّ الْمُتَّقِينَ  

{إلا الذين عاهدتم من المشركين ثم لم ينقصوكم شيئا} من شروط العهد {ولم يظاهروا} يعاونوا {عليكم أحدا} من الكفار {فأتموا إليهم عهدهم إلى} انقضاء {مدتهم} التي عاهدتم عليها {إن الله يحب المتقين} بإتمام العهود.