أُذِنَ لِلَّذِينَ يُقَٰتَلُونَ بِأَنَّهُمْ ظُلِمُوا۟ ۚ وَإِنَّ ٱللَّهَ عَلَىٰ نَصْرِهِمْ لَقَدِيرٌ ﴿٣٩﴾
Sanction is given unto those who fight because they have been wronged; and Allah is indeed Able to give them victory;
The Prophet ﷺ spent 13 years in Mecca enduring persecution without fighting. Fighting began only after he and his community had been driven out and attacked, and in the ten years in Medina, scholars estimate that all the battles together cost around a thousand lives or fewer on both sides.
The Meccans tortured and killed early Muslims, boycotted the clan of the Prophet ﷺ for three years and plotted to kill him. After the migration to Medina, the battles of Badr, Uhud and the Trench were fought to defend the city. Where he could, he preferred treaties, as in the Treaty of Hudaybiyyah, and the conquest of Mecca took place almost without bloodshed, with a general pardon.
Critics point to the battles against Jewish tribes of Medina, such as Banu Qurayzah, which broke treaties during the siege. Muslims respond that these were in the context of treason during wartime and that the judgment was by a leader of their own allies according to their own law. The Prophet's overall life is seen by Muslims as a model of mercy, as the Quran describes him.
أُذِنَ لِلَّذِينَ يُقَٰتَلُونَ بِأَنَّهُمْ ظُلِمُوا۟ ۚ وَإِنَّ ٱللَّهَ عَلَىٰ نَصْرِهِمْ لَقَدِيرٌ ﴿٣٩﴾
Sanction is given unto those who fight because they have been wronged; and Allah is indeed Able to give them victory;
وَمَآ أَرْسَلْنَٰكَ إِلَّا رَحْمَةًۭ لِّلْعَٰلَمِينَ ﴿١٠٧﴾
We sent thee not save as a mercy for the peoples.
وَقَٰتِلُوا۟ فِى سَبِيلِ ٱللَّهِ ٱلَّذِينَ يُقَٰتِلُونَكُمْ وَلَا تَعْتَدُوٓا۟ ۚ إِنَّ ٱللَّهَ لَا يُحِبُّ ٱلْمُعْتَدِينَ ﴿١٩٠﴾
Fight in the way of Allah against those who fight against you, but begin not hostilities. Lo! Allah loveth not aggressors.
The authentic hadith behind this answer, from Sahih al-Bukhari, Sahih Muslim and the Sunan with the grade of the scholars of hadith. Open a reference to read it in the hadith library of this site.
حَدَّثَنَا إِسْحَاقُ بْنُ إِبْرَاهِيمَ، قَالَ قُلْتُ لأَبِي أُسَامَةَ حَدَّثَكُمْ عُبَيْدُ اللَّهِ، عَنْ نَافِعٍ، عَنِ ابْنِ عُمَرَ ـ رضى الله عنهما ـ قَالَ وُجِدَتِ امْرَأَةٌ مَقْتُولَةً فِي بَعْضِ مَغَازِي رَسُولِ اللَّهِ صلى الله عليه وسلم، فَنَهَى رَسُولُ اللَّهِ صلى الله عليه وسلم عَنْ قَتْلِ النِّسَاءِ وَالصِّبْيَانِ.
حَدَّثَنَا عَبْدُ اللَّهِ بْنُ مُحَمَّدٍ، حَدَّثَنَا مُعَاوِيَةُ بْنُ عَمْرٍو، حَدَّثَنَا أَبُو إِسْحَاقَ، عَنْ مُوسَى بْنِ عُقْبَةَ، عَنْ سَالِمٍ أَبِي النَّضْرِ، مَوْلَى عُمَرَ بْنِ عُبَيْدِ اللَّهِ وَكَانَ كَاتِبًا لَهُ قَالَ كَتَبَ إِلَيْهِ عَبْدُ اللَّهِ بْنُ أَبِي أَوْفَى ـ رضى الله عنهما ـ فَقَرَأْتُهُ أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم فِي بَعْضِ أَيَّامِهِ الَّتِي لَقِيَ فِيهَا انْتَظَرَ حَتَّى مَالَتِ الشَّمْسُ. ثُمَّ قَامَ فِي النَّاسِ قَالَ " أَيُّهَا النَّاسُ، لاَ تَتَمَنَّوْا لِقَاءَ الْعَدُوِّ، وَسَلُوا اللَّهَ الْعَافِيَةَ، فَإِذَا لَقِيتُمُوهُمْ فَاصْبِرُوا، وَاعْلَمُوا أَنَّ الْجَنَّةَ تَحْتَ ظِلاَلِ السُّيُوفِ، ثُمَّ قَالَ اللَّهُمَّ مُنْزِلَ الْكِتَابِ وَمُجْرِيَ السَّحَابِ وَهَازِمَ الأَحْزَابِ، اهْزِمْهُمْ وَانْصُرْنَا عَلَيْهِمْ ".
وَحَدَّثَنِي حَجَّاجُ بْنُ الشَّاعِرِ، حَدَّثَنِي عَبْدُ الصَّمَدِ بْنُ عَبْدِ الْوَارِثِ، حَدَّثَنَا شُعْبَةُ، حَدَّثَنِي عَلْقَمَةُ بْنُ مَرْثَدٍ، أَنَّ سُلَيْمَانَ بْنَ بُرَيْدَةَ، حَدَّثَهُ عَنْ أَبِيهِ، قَالَ كَانَ رَسُولُ اللَّهِ صلى الله عليه وسلم إِذَا بَعَثَ أَمِيرًا أَوْ سَرِيَّةً دَعَاهُ فَأَوْصَاهُ . وَسَاقَ الْحَدِيثَ بِمَعْنَى حَدِيثِ سُفْيَانَ .
This answer follows the mainstream Sunni understanding and is general learning, not a fatwa. Where Muslims differ, the answer says so. Have a question of your own? Write to us.