Islamic military jurisprudence
Development of rulings: The first military rulings were formulated during the first century after Muhammad established an Islamic state in Medina. These rulings evolved in accordance with the interpretations of the Qur'an (the Islamic Holy scriptures) and Hadith (the recorded traditions, actions (behaviors), sayings and consents of Muhammad). The key themes in these rulings were the justness of war (Harb), and the injunction to jihad. The rulings do not cover feuds and armed conflicts in general.
Jihad (Arabic for "struggle") was given a military dimension after the oppressive practices of the Meccan Quraish against Muslims. It was interpreted as the struggle in God's cause to be conducted by the Muslim community. Injunctions relating to jihad have been characterized as individual as well as collective duties of the Muslim community. Hence, the nature of attack is important in the interpretation—if the Muslim community as a whole is attacked jihad becomes incumbent on all Muslims. Jihad is differentiated further in respect to the requirements within Muslim-governed lands (Dar al-Islam) and non-Muslim lands, both friendly and hostile.
According to Shaheen Sardar Ali and Javaid Rehman, both professors of law, the Islamic military jurisprudence are in line with rules of modern international law. They point to the dual commitment of Organisation of Islamic Cooperation (OIC) member states (representing most of the Muslim world) to Islamic law and the United Nations Charter, as evidence of compatibility of both legal systems.

Ethics of warfare: Fighting is justified for legitimate self-defense, to aid other Muslims and after a violation in the terms of a treaty, but should be stopped if these circumstances cease to exist. War should be conducted in a disciplined way, to avoid injuring non-combatants, with the minimum necessary force, without anger and with humane treatment towards prisoners of war.
During his life, Muhammad gave various injunctions to his forces and adopted practices toward the conduct of war. The most important of these were summarized by Muhammad's companion and first Caliph, Abu Bakr, in the form of ten rules for the Muslim army:

O people! I charge you with ten rules; learn them well! Stop, O people, that I may give you ten rules for your guidance in the battlefield. Do not commit treachery or deviate from the right path. You must not mutilate dead bodies. Neither kill a child, nor a woman, nor an aged man. Bring no harm to the trees, nor burn them with fire, especially those which are fruitful. Slay not any of the enemy's flock, save for your food. You are likely to pass by people who have devoted their lives to monastic services; leave them alone.
According to Tabari, the ten bits of "advice" that Abu Bakr gave was during the Expedition of Usama bin Zayd. During the Battle of Siffin, the Caliph Ali stated that Islam does not permit Muslims to stop the supply of water to their enemy. In addition to the Rashidun Caliphs, hadiths attributed to Muhammad himself suggest that he stated the following regarding the Muslim conquest of Egypt that eventually took place after his death:

You are going to enter Egypt a land where qirat (money unit) is used. Be extremely good to them as they have with us close ties and marriage relationships. When you enter Egypt after my death, recruit many soldiers from among the Egyptians because they are the best soldiers on earth, as they and their wives are permanently on duty until the Day of Resurrection. Be good to the Copts of Egypt; you shall take them over, but they shall be your instrument and help. Be Righteous to God about the Copts.
These principles were upheld by 'Amr ibn al-'As during his conquest of Egypt. A Christian contemporary in the 7th century, John of Nikiû, stated the following regarding the conquest of Alexandria by 'Amr:

On the twentieth of Maskaram, Theodore and all his troops and officers set out and proceeded to the island of Cyprus, and abandoned the city of Alexandria. And thereupon 'Amr the chief of the Moslem made his entry without effort into the city of Alexandria. And the inhabitants received him with respect; for they were in great tribulation and affliction. And Abba Benjamin, the patriarch of the Egyptians, returned to the city of Alexandria in the thirteenth year after his flight from the Romans, and he went to the Churches, and inspected all of them. And every one said: 'This expulsion (of the Romans) and victory of the Moslem is due to the wickedness of the emperor Heraclius and his persecution of the Orthodox through the patriarch Cyrus. This was the cause of the ruin of the Romans and the subjugation of Egypt by the Moslem. And 'Amr became stronger every day in every field of his activity. And he exacted the taxes which had been determined upon, but he took none of the property of the Churches, and he committed no act of spoliation or plunder, and he preserved them throughout all his days.
The principles established by the early Caliphs were also honoured during the Crusades, as exemplified by Sultans such as Saladin and Al-Kamil. For example, after Al-Kamil defeated the Franks during the Crusades, Oliverus Scholasticus praised the Islamic laws of war, commenting on how Al-Kamil supplied the defeated Frankish army with food:

Who could doubt that such goodness, friendship and charity come from God? Men whose parents, sons and daughters, brothers and sisters, had died in agony at our hands, whose lands we took, whom we drove naked from their homes, revived us with their own food when we were dying of hunger and showered us with kindness even when we were in their power.
The early Islamic treatises on international law from the 9th century onwards covered the application of Islamic ethics, Islamic economic jurisprudence and Islamic military jurisprudence to international law, and were concerned with a number of modern international law topics, including the law of treaties; the treatment of diplomats, hostages, refugees and prisoners of war; the right of asylum; conduct on the battlefield; protection of women, children and non-combatant civilians; contracts across the lines of battle; the use of poisonous weapons; and devastation of enemy territory.

Criteria for soldiering: Muslim jurists agree that Muslim armed forces must consist of debt-free adults who possess a sound mind and body. In addition, the combatants must not be conscripted, but rather enlist of their free will, and with the permission of their family.

Legitimacy of war: Muslims have struggled to differentiate between legitimate and illegitimate wars. Fighting in self-defense is not only legitimate but considered obligatory upon Muslims, according to the Qur'an. The Qur'an, however, says that should the enemy's hostile behavior cease, then the reason for engaging the enemy also lapses.

Defensive conflict: According to the majority of jurists, the Qur'anic casus belli (justification of war) are restricted to aggression against Muslims and fitna—persecution of Muslims because of their religious belief. They hold that unbelief in itself is not the justification for war. These jurists therefore maintain that only combatants are to be fought; noncombatants such as women, children, clergy, the aged, the insane, farmers, serfs, the blind, and so on are not to be killed in war. Thus, the Hanafī Ibn Najīm states: "the reason for jihād in our [the Hanafīs] view is kawnuhum harbā ‛alaynā [literally, their being at war against us]." The Hanafī jurists al-Shaybānī and al-Sarakhsī state that "although kufr [unbelief in God] is one of the greatest sins, it is between the individual and his God the Almighty and the punishment for this sin is to be postponed to the dār al-jazā’, (the abode of reckoning, the Hereafter)." War, according to the Hanafis, can't simply be made on the account of a nation's religion. Abdulaziz Sachedina argues that the original jihad according to his version of Shi'ism was permission to fight back against those who broke their pledges. Thus the Qur'an justified defensive jihad by allowing Muslims to fight back against hostile and dangerous forces.

Offensive conflict: Muhammad ibn Idris ash-Shafi`i (d. 820), founder of the Shafi'i school of thought, was the first to permit offensive jihad, limiting this warfare against pagan Arabs only, not permitting it against non-Arab non-Muslims. This view of al-Shafi'i is mitigated by the fact that an opposite view, in agreement with the majority, is also attributed to al-Shafi'i.
According to Abdulaziz Sachedina, offensive jihad raises questions about whether jihad is justifiable on moral grounds. He states that the Qur'an requires Muslims to establish just public order, increasing the influence of Islam, allowing public Islamic worship, through offensive measures. To this end, the Qur'anic verses revealed required Muslims to wage jihad against unbelievers who persecuted them. This has been complicated by the early Muslim conquests, which he argues were although considered jihad by Sunni scholars, but under close scrutiny can be determined to be political. Moreover, the offensive jihad points more to the complex relationship with the "People of the book".