9:7
How can there be a league, before Allah and His Messenger, with the Pagans, except those with whom ye made a treaty near the sacred Mosque? As long as these stand true to you, stand ye true to them: for Allah doth love the righteous.
According to the commentary, verses 7–24 were revealed prior to the conquest of Makkah during a period when the Muslim community was preparing for a decisive confrontation with the Quraysh. During this time, disagreement emerged among some Muslims regarding whether they should engage in conflict with the Quraysh. The debate was influenced in part by certain hypocrites in Madinah who discouraged military action, arguing that the Quraysh were the custodians of the Sacred Sanctuary in Makkah and that fighting them would involve bloodshed within a holy area. In response, the Qur’anic passage admonishes this perspective by questioning the possibility of maintaining reliable treaties with the idolaters, emphasizing that their hostility toward the Muslim community made them unlikely to uphold such agreements if given the opportunity. The verse therefore states that no treaty with the idolaters could be considered binding except for specific agreements concluded at the Sacred Mosque, particularly the Treaty of Ḥudaybiyah. The Muslims were instructed to honor this treaty as long as the other party remained faithful to its terms, since God loves those who fulfill their covenants (Islamic commentary on Qur’an 9:7–24).
References:
Ahmad, Israr. (2012). Bayan ul Quran. Bayan Ul Quran – Dr. Israr Ahmed (English)