Sura At-Tawba

9:4

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

Härifrån skall undantas de bland avgudadyrkarna som har slutit fördrag med er och som inte i något avseende vållat er skada och inte har bistått någon [i fientliga företag] mot er. Fullgör era förpliktelser enligt fördragen med dem, så länge de är i kraft. Gud älskar dem som fruktar Honom.

Tafsir 9:4

The idolaters who are excluded from the previous ruling are those with whom you entered into a treaty and they honoured the treaty in full. So there will be a complete fulfilment of the treaty with them until the end of the period. Allah loves those who are mindful of Him by obeying His sacred law, which includes fulfilment of treaties, and by avoiding His prohibitions, which include the prohibition of treachery.