Referring to such verses, there are some who attempt to give the impression that Islam is a religion of war and violence. This is totally untrue. Such verses relate in a restricted sense, to those who have unilaterally attacked the Muslims. The above verse does not convey the general command of Islam. The truth of the matter is that the Quran was not revealed in the complete form in which it exists today. It was revealed from time to time, according to the circumstances, over a time span of 23 years. If this is divided into years of war and peace, the period of peace amounts to 20 years, while that of war amounts only to 3 years. The revelations during these 20 peaceful years were the peaceful teachings of Islam as are conveyed in the verses regarding the realization of God, worship, morality, justice, etc.
This division of commands into different categories is a natural one and is found in all religious books. The same is true of the Quran. When the Prophet of Islam emigrated from Makkah to Madinah, the idolatrous tribes were aggressive towards him. But the Prophet always averted their attacks by the exercise of patience and the strategy of avoidance. However on certain occasions no other options existed, save that of retaliation. Therefore, he had do battle on certain occasions. It was these circumstances, which occasioned those revelations relating to war. These commands, being specific to certain circumstances, had no general application. They were not meant to be valid for all time to come. That is why; the permanent status of the Prophet has been termed a ‘mercy for all mankind.’ (21:107)