He prescribed for them the fighting of all who would not make peace with them; but as for those who sought peace, they were not commanded to fight them, as the Most High says:
If they incline to peace, then incline to it as well, and put your trust in God. (8:61)
He also says:
Except for those who ally themselves with a people between whom and you there is a treaty, or who come to you, their hearts shrinking from fighting you or fighting their own people. Had God willed, He could have given them power over you and they would have fought you. So if they withdraw from you, do not fight you, and offer you peace, God gives you no way against them. (4:90)
For this reason the Prophet—peace and blessings be upon him—concluded with many of the idolaters both open-ended and time-limited covenants. The time-limited treaties were binding, whereas the open-ended ones were not; either party could annul them. After God granted the conquest of Mecca and the Prophet—peace be upon him—set out on the expedition of Tabuk in the ninth year after the Hijrah—the last of his campaigns—he was commanded on that occasion to fight the People of the Book until they paid the jizyah in humble submission, as the Almighty says:
Fight those who do not believe in God or the Last Day, who do not forbid what God and His Messenger have forbidden, and who do not adopt the religion of truth—among those who were given the Scripture—until they pay the jizyah directly, in willing submission, and feel themselves subdued. (9:29)
When he returned from Tabuk, God revealed Sūrat al-Barāʾah, describing the states of the hypocrites with the recurring phrase, “And among them…,” “And among them….” For this reason the sūrah is also called al-Kāshifah (“the Unveiler”), al-Mubaʿthirah (“the Scatterer”), and al-Fāḍiḥah (“the Disgracer”). In it, He commanded that the open-ended treaties be repudiated and that the Sacred Precinct be barred to the unbelievers.