International humanitarian law (IHL), often referred to as the laws of war, the laws and customs of war or the law of armed conflict, is the legal corpus that comprises "the Geneva Conventions and the Hague Conventions, as well as subsequent treaties, case law, and customary international law." It defines the conduct and responsibilities of belligerent nations, neutral nations and individuals engaged in warfare, in relation to each other and to protected persons, usually meaning civilians.
The law is mandatory for nations bound by the appropriate treaties. There are also other customary unwritten rules of war, many of which were explored at the Nuremberg War Trials. By extension, they also define both the permissive rights of these powers as well as prohibitions on their conduct when dealing with irregular forces and non-signatories.
Two Historical Streams: The Law of Geneva and The Law of The Hague
Modern International Humanitarian Law is made up of two historical streams: the law of The Hague referred to in the past as the law of war proper and the law of Geneva or humanitarian law. The two streams take their names from a number of international conferences which drew up treaties relating to war and conflict, in particular the Hague Conventions of 1899 and 1907, and the Geneva Conventions, the first which was drawn up in 1863. Both are branches of jus in bello, international law regarding acceptable practices while engaged in war and armed conflict.
The Law of The Hague, or the Laws of War proper,"determines the rights and duties of belligerents in the conduct of operations and limits the choice of means in doing harm."  In particular, it concerns itself with the definition of combatants, establishes rules relating to the means and methods of warfare, and examines the issue of military objectives.
Systematic attempts to limit the savagery of warfare only began to develop in the 19th century. Such concerns were able to build on the changing view of warfare by states influenced by the Age of Enlightenment. The purpose of warfare was to overcome the enemy state and this was obtainable by disabling the enemy combatants. Thus, "(t)he distinction between combatants and civilians, the requirement that wounded and captured enemy combatants must be treated humanely, and that quarter must be given, some of the pillars of modern humanitarian law, all follow from this principle."
The Law of Geneva
The massacre of civilians in the midst of armed conflict has a long and dark history. Selected examples include: Moses, speaking for the god of the Israelites, ordering the killing of all the Midianite women and male children; the massacres of the Kalingas by Ashoka in India, the massacre of some 100,000 Hindus by the Muslim troops of Timur (Tamerlane) or the Crusader massacres of Jews and Muslims in the Siege of Jerusalem (1099), to name a few examples drawn from a long list in history. Fritz Munch sums up historical military practice before 1800: "The essential points seem to be these: In battle and in towns taken by force, combatants and non-combatants were killed and property was destroyed or looted. In the 17th century, the Dutch jurist Hugo Grotius wrote "Wars, for the attainment of their objects, it cannot be denied, must employ force and terror as their most proper agents."
Humanitarian Norms in History
However, even in the midst of the carnage of history, there were expressions of humanitarian norms to protect the victims of armed conflicts, i.e. the wounded, the sick and the shipwrecked which date back to ancient times.
In the Old Testament, the King of Israel prevents the slaying of the captured following the prophet, Elisha's admonition, to spare enemy prisoners: In answer to a question from the King, he said, "You shall not slay them. Would you slay those whom you have taken captive with your sword and with your bow? Set bread and water before them, that they may eat and drink and go to their master.”
In ancient India there are records, for example the Laws of Manu, describing the types of weapons that should not be used. "When he fights with his foes in battle, let him not strike with weapons concealed (in wood), nor with (such as are) barbed, poisoned, or the points of which are blazing with fire. There is also the command not to strike a eunuch nor the enemy "who folds his hands in supplication....Nor one who sleeps, nor one who has lost his coat of mail, nor one who is naked, nor one who is disarmed, nor one who looks on without taking part in the fight...".
Islamic law indicates that "noncombatants who did not take part in fighting such as women, children, monks and hermits, the aged, blind, and insane" were not to be molested. The first Caliph, Abu Bakr, proclaimed "Do not mutilate. Do not kill little children or old men or women. Do not cut off the heads of palm trees or burn them. Do not cut down fruit trees. Do not slaughter livestock except for food." Islamic jurists have held that a prisoner should not be killed as he "cannot be held responsible for mere acts of belligerency."  Islamic law did not spare all non-combatants. In the case of those who refused to convert to Islam or pay an alternative tax, Muslims "were allowed in principle to kill any one of them, combatants or noncombatants, provided they were not killed treacherously and with mutilation."