Surah At-Tawbah 9:7
كَيْفَ يَكُونُ لِلْمُشْرِكِينَ عَهْدٌ عِندَ ٱللَّهِ وَعِندَ رَسُولِهِۦٓ إِلَّا ٱلَّذِينَ عَـٰهَدتُّمْ عِندَ ٱلْمَسْجِدِ ٱلْحَرَامِ ۖ فَمَا ٱسْتَقَـٰمُوا۟ لَكُمْ فَٱسْتَقِيمُوا۟ لَهُمْ ۚ إِنَّ ٱللَّهَ يُحِبُّ ٱلْمُتَّقِينَ
How can there be for the polytheists a treaty in the sight of Allāh and with His Messenger, except for those with whom you made a treaty at al-Masjid al-Ḥarām? So as long as they are upright toward you, be upright toward them. Indeed, Allāh loves the righteous [who fear Him].
Translation: Saheeh International
Tafsir
How can the idolaters have a pact with God and His Messenger — they cannot —while they disbelieve in God and His Messenger acting treacherously; except for those with whom you made a pact at the Sacred Mosque? the day of al-Hudaybiyya — these were Quraysh for whom an exception was made earlier Q. 94. …
Excerpt from Tafsir al-Jalalayn, commentary on 9:7, via Quran.com. The reader has the full commentary and 9 more tafsirs.