Did the Prophet Muhammad fight wars?
Question 1232
Question
Did the Prophet Muhammad fight in wars, why did he fight, and what rules did he follow in battle?
Summary of answer
The Prophet ﷺ endured thirteen years of persecution in Mecca without taking up arms. After the emigration to Medina, the Quran gave the wronged permission to defend themselves (22:39), and he led his community in battles such as Badr, Uhud, and the Trench, under rules that protected women, children, and noncombatants. He accepted a hard peace at Hudaybiyya and, when he entered Mecca, granted its people safety.
Answer
الحمد لله Praise be to Allah.

Did the Prophet Muhammad ﷺ fight wars? He did, in the last ten years of his life, after the Quran gave his persecuted community permission to defend itself. For thirteen years before that, in Mecca, he and his followers were mocked, boycotted, beaten, and driven from their homes without raising a sword. When he did fight, he fought under rules that protected the innocent, and he chose peace and forgiveness whenever they were offered.
Did the Prophet ﷺ fight in battles?
Yes. Ibn ʿAbbās summed up his mission: revelation began when he was forty, he stayed thirteen years in Mecca, and then he lived ten years in Medina (Sahih al-Bukhari 3851). Every battle belongs to those Medinan years. The Companion Zayd ibn Arqam counted nineteen expeditions that the Prophet ﷺ led in person (Sahih al-Bukhari 3949). Some ended without a fight. The great battles were Badr, Uhud, the Trench, and Hunayn, and the Quran names two of them (3:123, 9:25).
The first permission to fight came with its reason:
أُذِنَ لِلَّذِينَ يُقَٰتَلُونَ بِأَنَّهُمۡ ظُلِمُواْۚ وَإِنَّ ٱللَّهَ عَلَىٰ نَصۡرِهِمۡ لَقَدِيرٌ
“Permission is given to those who are fought against, because they have been wronged, and Allah is able to help them.”
The next verse describes them as people “driven from their homes without right, only because they said, Our Lord is Allah,” and warns that without such defense, monasteries, churches, synagogues, and mosques would be torn down (22:40).
Why did the Prophet ﷺ fight?
The Quran limits fighting to those who fight: “Fight in the way of Allah those who fight you, and do not transgress” (Quran 2:190). If an enemy withdraws and offers peace, “Allah has given you no way against them” (4:90).
At Badr, a small Muslim force met a far larger Meccan army, and the Quran reminds them that Allah helped them “when you were weak” (3:123). At Uhud the Meccans returned for revenge, and many Muslims were killed. At the Trench, a coalition of tribes besieged Medina itself, and the Muslims dug a trench around the city to hold them off. These were wars for the survival of a small community that its enemies had sworn to destroy. The full meaning of jihad, of which fighting is one narrow part, is explained in What is jihad?
What rules of war did the Prophet ﷺ set?
He sent no army without instructions of mercy:
«اغْزُوا بِاسْمِ اللَّهِ وَفِي سَبِيلِ اللَّهِ وَقَاتِلُوا مَنْ كَفَرَ بِاللَّهِ اغْزُوا وَلاَ تَغْدِرُوا وَلاَ تَغُلُّوا وَلاَ تُمَثِّلُوا وَلاَ تَقْتُلُوا وَلِيدًا»
“Go out in the name of Allah and in the way of Allah, and fight those who deny Allah. Go out, and do not betray, do not steal from the spoils, do not mutilate, and do not kill a child.”
Sunan Abi Dawud 2613, graded sahih by al-Albani
When he saw a woman who had been killed after one battle, he forbade the killing of women and children (Sahih al-Bukhari 3015). He taught his soldiers, “Do not wish to meet the enemy; ask Allah for well-being” (Sahih al-Bukhari 3024). The Quran ordered that prisoners be released at the end of a war, “either as a favor or for ransom” (47:4), and the captives of Badr were ransomed and sent home.
What happened at Hudaybiyya?
A few years later the Prophet ﷺ set out with his Companions to perform the lesser pilgrimage. The Quraysh barred his way. He chose a treaty over a fight, and he accepted terms that many Companions found humiliating: the Muslims would turn back that year and return the next. When the Meccans refused to let the document call him “the Messenger of Allah,” he had the title erased and signed as “Muhammad son of ʿAbdullāh” (Sahih al-Bukhari 2699). On the way home the Quran called this peace “a clear victory” (Quran 48:1).
How did the Prophet ﷺ treat Mecca when he returned?
When the Quraysh broke the treaty, he marched on Mecca with a large army and entered it with very little fighting. He announced:
«مَنْ دَخَلَ دَارَ أَبِي سُفْيَانَ فَهُوَ آمِنٌ وَمَنْ أَلْقَى السِّلاَحَ فَهُوَ آمِنٌ وَمَنْ أَغْلَقَ بَابَهُ فَهُوَ آمِنٌ»
“Whoever enters the house of Abu Sufyān is safe, whoever lays down his weapons is safe, and whoever closes his door is safe.”
Abu Sufyān had led the Meccan armies against him for years. The city that had persecuted him and killed his Companions received his pardon.
What about the hardest episodes?
The most difficult event of these years followed the siege of the Trench. The Jewish tribe of Qurayẓa, who lived in Medina, had supported the besieging coalition (33:26). When they surrendered, the Prophet ﷺ gave the judgment to Saʿd ibn Muʿādh, a leader of the Muslims of Medina, who ruled that their fighting men be put to death and their women and children taken captive (Sahih al-Bukhari 4122). Muslim and non-Muslim historians have long discussed the numbers in the later biographies and the wartime customs of seventh-century Arabia under which the judgment was given. For the wars that followed, the jurists built the law on the instructions the Prophet ﷺ gave his armies: protection for every noncombatant, faithfulness to treaties, and mercy to prisoners.
A Prophet of peace in a time of war
The Prophet ﷺ lived in an age when tribes fought to survive. He fought when he had to, and he chose peace whenever it was offered, because the Quran told him to:
۞وَإِن جَنَحُواْ لِلسَّلۡمِ فَٱجۡنَحۡ لَهَا وَتَوَكَّلۡ عَلَى ٱللَّهِ
“If they incline to peace, incline to it as well, and put your trust in Allah.”
He died with his armor pawned to a Jewish man for some barley to feed his family (Sahih al-Bukhari 2916). Today, those who kill civilians in his name break every rule he set (Is ISIS Islamic?). His way is told more fully in Is Islam a religion of peace? and Who was the Prophet Muhammad? May Allah make us people of peace, firm against injustice and generous in forgiveness.
And Allah knows best. والله أعلم
Frequently asked questions
How many battles did the Prophet Muhammad fight?
The Companion Zayd ibn Arqam said the Prophet ﷺ went out on nineteen expeditions (Sahih al-Bukhari 3949). Several of them, such as the march to Tabuk, ended without any fighting, and the major battles were Badr, Uhud, the Trench, and Hunayn.
Was Muhammad a warlord?
No. He bore thirteen years of persecution without fighting, fought only after the Quran permitted the wronged to defend themselves, accepted a peace treaty on hard terms, and forgave Mecca. He died with his armor pawned to a Jewish man for barley to feed his family (Sahih al-Bukhari 2916).
Did the Prophet allow killing women and children in war?
No. When he saw a woman who had been killed after a battle, he forbade the killing of women and children (Sahih al-Bukhari 3015), and he told his commanders never to kill a child or mutilate the dead (Sunan Abi Dawud 2613).
Does Islam allow offensive war today?
Islamic law permits fighting only in defense against aggression, declared by a legitimate public authority and bound by strict ethics. Attacks on civilians are forbidden, as explained in What is jihad?
Related questions
Sources
- The Quran 2:190, 3:123, 4:90, 8:61, 22:39–40, 33:26, 47:4, 48:1
- Sahih al-Bukhari 2699, 2916, 3015, 3024, 3851, 3949, 4122
- Sahih Muslim 1780c; Sunan Abi Dawud 2613
- Ibn Ishaq, Sīrat Rasūl Allāh, trans. A. Guillaume, The Life of Muhammad (1955)
Image: TheHadiRahim, The Green Dome of the Prophet's Mosque, Medina, 2025. CC0, via Wikimedia Commons.. Image credits