Military law

Military law, on a practical basis, is prescribed by individual nations, but subject to differences with their national law for civilians, as well as overriding principles of international war. Generally respected military law is formulated within the context of just war theory.

Were a civilian official to order subordinates into situations known to be likely to cause them to be injured or killed, such an official would quite likely face an indictment for manslaughter. This does not mean that a civilian official cannot, for example, send firefighters or police officers into situations that are highly dangerous.

In the military context, however, generally accepted concepts of military necessity often mean that the first waves of troops attacking the enemy are certain to suffer extremely high casualties. Alternatively, a military commander may order selected troops to make a deceptive action which is intended to draw fire upon them, or to hold a rear guard position against an enemy not known to take prisoners.

International law
There is no single reference for international military law, although there are a collection of agreements often grouped as "customary military law" or "laws of land warfare"

At the core of formal agreements are the Hague Conventions and Geneva Conventions. There are a wide range of relevant technical agreements, such as the Convention on Certain Conventional Weapons or the Convention on the Prohibition of the Use, Stockpiling, Production and Transfer of Anti-Personnel Mines and on Their Destruction. Individual national military law may not reflect agreements that the nation has not ratified, or treaties it has explicitly repudiated or refused to sign.

National implementation
A given country typically will authorize its armed services to create regulations for all services and for specific branches of service, which have the force of law within the military. There may also be both overall codes for military trials and related functions, such as the U.S. Uniform Code of Military Justice.