LONDON -- The United Nations says it is collecting evidence of war crimes by both sides in the Israel-Hamas war, which began with the militant group's brutal Oct. 7 cross-border attack and was followed by Israel's relentless bombardment and a siege of Gaza.

At least 1,400 Israelis and more than 9,200 people in Gaza have been killed, and thousands of others have been injured. Most of the injured and dead are civilians, including many women and children.

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 recognized laws and resolutions, including the U.N. charter, which prohibits wars of aggression but allow countries to defend themselves.

Battlefield behaviour is governed by international humanitarian laws including the Geneva Conventions, which were drawn up after World War II and agreed to 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 conventions initially dealt with the behaviour of combatants. They were updated later to set out rules for the treatment of civilians in war zones. Civilian deaths aren't necessarily war crimes, but civilians must not be targeted deliberately or indiscriminately, and military operations must be proportionate.

Another key law governing war is the Rome Statute of the International Criminal Court. It holds that intentional attacks targeting civilians, civilian settlements and humanitarian workers, the destruction of property where not militarily necessary, sexual violence and unlawful deportation are war crimes.

International agreements ban certain weapon types, such as chemical and biological munitions. Most but not all countries have signed up to these.

HAS HAMAS COMMITTED WAR CRIMES?

Hamas has fired thousands of rockets at Israeli towns and cities, and on Oct. 7, it sent hundreds of gunmen across the border from Gaza. They attacked and killed civilians -- including children and retirees -- in their homes and neighbourhoods, and kidnapped scores of others. Israel says at least 1,400 people died and more than 240 others were abducted. Roughly 5,400 people in Israel have also been injured since the war started.

Haim Abraham, a lecturer in law at University College London, said the evidence of crimes is clear.

"They massacred civilians at their homes. They kidnapped civilians, taking them hostage. All of these things are clearly war crimes," he said.

Jeanne Sulzer, a lawyer with the Commission for International Justice of Amnesty International France, said the Geneva Conventions state that "civilians should never be taken hostage. If they are, that may be characterized as a war crime."

HAS ISRAEL'S RESPONSE BEEN LEGAL?

The Israeli military has pounded Hamas-ruled Gaza with airstrikes, blocked deliveries of food, water, fuel and electricity, and told people to leave northern Gaza for the southern part of the strip. The Gaza Health Ministry says more than 9,200 Palestinians have been killed in Gaza so far, mostly women and children, and more and than 23,000 people have been wounded during the weeks of Israeli bombardment.

Critics accuse Israel of collectively punishing Gaza's 2 million residents. Hundreds of thousands have heeded Israel's warnings and fled south in hope of escaping the fighting. After weeks of heavy bombardment, Israel sent in ground troops that are close to encircling Gaza City. Israel has allowed limited humanitarian aid, but not fuel, to cross into southern Gaza from Egypt.

The International Committee of the Red Cross has said the Israeli instruction for hundreds of thousands of people to leave their homes, "coupled with the complete siege explicitly denying them food, water, and electricity, are not compatible with international humanitarian law."

The Israeli army says it follows international law and strikes only legitimate military targets as it seeks to root out militants who it claims embed themselves among the civilian population.

Palestinian civilians have died in strikes on residential buildings, including in southern areas where they were told to go. An Oct. 31 strike on the Jabaliya refugee camp on the outskirts of Gaza City killed a senior Hamas commander, but also killed dozens of civilians.

The laws of war say medical facilities should not be targeted. Hospitals have been hit by blasts during the current conflict, including a deadly Oct. 17 explosion at the al-Ahli Arab Hospital that led to international calls for a war crimes investigation.

There were conflicting accusations of who was responsible for the hospital blast, with Hamas officials in Gaza blaming an Israeli airstrike and Israel saying it was caused by a an errant rocket launched by Palestinian militants. U.S., British and French intelligence services also concluded it was likely caused by a misfired rocket. An Associated Press analysis of video, photos and satellite imagery, as well as consultation with experts, showed the cause was likely a rocket launched from Palestinian territory that misfired in the air and crashed to the ground. However, a definitive conclusion could not be reached.

There have also been conflicting accounts of the blast's death toll. Gaza officials initially said 500 people were killed. U.S. officials said the number was likely between 100 and 300.

The human rights groups Amnesty International and Human Rights Watch have accused Israel of using munitions containing white phosphorus. The incendiary substance is not banned, but its use in densely populated areas has been widely condemned.

Israel maintains that it uses the incendiaries only as a smokescreen and not to target civilians. Its military said in a statement to the AP last month that the main type of smokescreen shells it uses "do not contain white phosphorous." But it didn't rule out its use in some situations.

CAN LAWBREAKERS BE HELD TO ACCOUNT?

A U.N. commission of inquiry said it was "collecting and preserving evidence of war crimes committed by all sides" in the current conflict. That evidence could be added to an ongoing investigation by the International Criminal Court into the situation in the Palestinian territories.

The Netherlands-based ICC has the power to prosecute nations' officials for violations and order compensation for victims. But some countries -- including the United States, Russia and Israel -- do not recognize the court's jurisdiction, and the ICC does not have a police force to execute arrest warrants.

ARE THERE ANY OTHER ROUTES?

Although the ICC is the only permanent international tribunal set up to prosecute war crimes, other international courts including the International Court of Justice and the European Court of Human Rights can hear cases related to alleged violations. So can domestic courts in Israel or elsewhere. Under U.S. law, American victims could try to bring claims for compensation against Hamas in U.S. courts.

As with Russia's invasion of Ukraine, the prospect of prosecuting war crimes in the current conflict seems remote. But Amnesty International's Sulzer said "legal initiatives are already a reality." She said French national and dual citizen victims of the Hamas attacks have already filed complaints in French courts.

Breaches of international law can also trigger sanctions such as those imposed on Russia by the United States, the European Union and others over the invasion of Ukraine. And in rare cases, they can draw U.N.-authorized military intervention.