Hamas and Israel have both been accused of breaking international law during their latest conflict, and the United Nations says it is collecting evidence of war crimes by all sides. Enforcing the law amid the fog of war is difficult. Holding perpetrators to account once conflicts are over has often proved elusive.
Here is a look at some of the issues.
WHAT ARE THE RULES OF WAR? The rules of armed conflict are governed by a set of internationally recognised laws and resolutions, including the United Nations charter, which prohibits aggressive wars but allows countries the right to self-defence.
Battlefield behaviour has international humanitarian laws including the Geneva Conventions, drawn up after World War II and agreed on by almost every nation.
The four conventions agreed upon in 1949 set out that civilians, the wounded and prisoners must be treated humanely in wartime. They ban murder, torture, hostage-taking and «humiliating and degrading treatment» and require fighters to treat the other side's sick and wounded.
The rules apply both to wars between nations and conflicts, like that between Israel and Hamas, in which one of the parties is not a state.
Another key document in the law of war is the founding Rome Statue of the International Criminal Court, which defines as war crimes acts including intentional attacks on civilians, civilian settlements or humanitarian workers, destroying property where not militarily necessary, sexual violence and unlawful deportation.
Other agreements ban certain types of weapons, such as chemical or biological munitions. Most but not all countries have signed up to these.