Allah Most High commanded His Messenger, peace and blessings be upon him, to refrain from fighting the polytheists. Then, when he emigrated to Madinah, He commanded him, by this verse, to fight those among them who fought him. Al-Rabi‘ ibn Anas said: “This was the first verse revealed concerning fighting.” Thereafter, He commanded him to fight all the polytheists, whether they fought or did not fight, in His words: “Kill the polytheists.” Thus, this verse was abrogated by it. It is also said that nearly seventy verses were abrogated by the words, “Kill the polytheists.”
His words, “Do not transgress,” mean: do not initiate fighting against them. It is also said that this verse is clear and not abrogated: the Prophet, peace and blessings be upon him, was commanded to fight those who fight. The meaning of His words, “Do not transgress,” is: do not kill women, children, the very old, monks, or anyone who offers you peace. This is the view of Ibn ‘Abbas and Mujahid.
Abu al-Hasan al-Sarakhsi informed us; Zahir ibn Ahmad informed us; Abu Bakr ibn Sahl al-Quhustani, known as Abu Turab, informed us; Muhammad ibn ‘Isa al-Tarsusi informed us; Yahya ibn Bukayr informed us; al-Layth ibn Sa‘d informed us, from Jarir ibn Hazim, from Shu‘bah, from ‘Alqamah ibn Yazid, from Sulayman ibn Buraydah, from his father, who said: Whenever the Prophet, peace and blessings be upon him, dispatched an army, he would say: “Go forth to battle in the name of Allah and in the cause of Allah. Fight those who disbelieve in Allah. Do not misappropriate the spoils, and do not kill a woman, a child, or an elderly man.” (1)
Al-Kalbi related from Abu Salih, from Ibn ‘Abbas, that this verse was revealed concerning the Treaty of al-Hudaybiyyah. The Messenger of Allah, peace and blessings be upon him, set out with his Companions for Umrah, and they numbered one thousand four hundred. They journeyed until they encamped at al-Hudaybiyyah, where the polytheists prevented them from reaching the Sacred House. He therefore made peace with them on the condition that he would return that year, and that they would leave Makkah open to him for three days the following year, so that he might circumambulate the House.
When the following year came, the Messenger of Allah, peace and blessings be upon him, and his Companions prepared for the compensatory Umrah. They feared that Quraysh would not honour their agreement and would prevent them from reaching the Sacred House. The Companions of the Messenger of Allah, peace and blessings be upon him, disliked fighting them during the sacred month and within the Sacred Sanctuary. So Allah Most High revealed: “Fight in the way of Allah”—meaning, while in the state of ihram—“those who fight you”—meaning Quraysh—“but do not transgress,” by initiating fighting within the Sacred Sanctuary while in ihram. “Indeed, Allah does not love the transgressors.”