AP — A jittery Israeli military is gearing up for what could become its next big battle: dealing with UN investigations that could result in war-crimes allegations.

The army has beefed up its legal staff, is conducting internal investigations of its wartime actions and has prepared a detailed PR campaign of satellite photos and video clips — hoping to persuade the world that its war against Hamas was justified.

“We take our business seriously, and as such we operate within the rules and regulations under the laws of war,” said Lt. Col. Peter Lerner, a military spokesman.

Israel launched the war on July 8 with a massive aerial bombardment of the Gaza Strip in response to weeks of heavy rocket fire. It later sent in ground troops to destroy a network of tunnels used by Hamas militants. Hamas and other militant groups fired thousands of rockets and mortars into Israel.

More than 2,100 Palestinians were killed in the 50 days of fighting, most of them civilians, according to UN and Palestinian estimates in the Hamas-run Strip. Thousands of buildings were destroyed and tens of thousands of people were left homeless. Seventy-two people were killed on the Israeli side, including six civilians.

Palestinians inspect the rubble of a destroyed shopping center after an Israeli airstrike overnight in the southern Gaza Strip city of Rafah, on August 24, 2014. (Photo credit: Abed Rahim Khatib/Flash90)

Palestinians inspect the rubble of a destroyed shopping center after an Israeli airstrike overnight in the southern Gaza Strip city of Rafah, on August 24, 2014. (photo credit: Abed Rahim Khatib/Flash90)

Israel argues that the heavy civilian death toll is Hamas’s fault, accusing the militant group of launching rockets — and drawing retaliation — from schoolyards, residential areas and mosques. This claim will be central to any defense of the military’s conduct.

“What the military has been doing throughout the entire operation is showing Hamas as it truly is, an organization that hides behind civilians and intentionally locates its weapons in houses, schools and mosques,” Lerner said.

The argument will be weighed against the principle of proportionality — which is essentially a judgment call on whether the force applied was reasonable.

Mushir al-Masri, a Hamas official in Gaza, dismissed the Israeli allegations, saying the claims that Hamas used houses and mosques for attacks are “to cover the brutal crimes they committed” in Gaza. “The war on Gaza was live on TV screens and the world saw who was under the rubble of the houses and who was killed in the schools,” he said.

Judge Richard Goldstone (second from right) at public hearings in 2009 about alleged Israeli violations committed during Operation Cast Lead (photo credit: UN/Flash 90)

Judge Richard Goldstone (second from right) and Christine Chinkin (right) at public hearings in 2009 about alleged Israeli violations committed during Operation Cast Lead. (photo credit: UN/Flash 90)

The threat of international action against Israel is real. Following a similar military operation in 2009, a UN fact-finding mission headed by South African jurist Richard Goldstone said he found strong evidence that both Israel and Hamas had committed war crimes — Israel by deliberately or recklessly targeting Gaza civilians, and Hamas by launching indiscriminate rocket attacks at Israeli cities. While Goldstone later backtracked from his main conclusions, the report was never changed.

The UN Human Rights Council, which has a long history of criticizing Israel, has already appointed a commission of inquiry to look into the latest fighting. The commission’s report is expected next March.

Palestinian Authority President Mahmoud Abbas recites a prayer in memory of those killed during the Gaza campaign ahead of a press conference on August 26, 2014 in the West Bank city of Ramallah, to formally announce a ceasefire with Israel.  (photo credit: AFP/Abbas Momani)

Palestinian Authority President Mahmoud Abbas recites a prayer in memory of those killed during the Gaza campaign ahead of a press conference on August 26, 2014, in the West Bank city of Ramallah, to formally announce a ceasefire with Israel. (photo credit: AFP/Abbas Momani)

Western-backed Palestinian President Mahmoud Abbas is also threatening to seek membership in the International Criminal Court in order to press charges against Israel. Officials say he will do so if he fails to persuade the UN Security Council this month to impose a deadline for Israel to withdraw from occupied lands and establish a Palestinian state. The US, which wields veto power in the council, has already reacted coolly to the Palestinian plan.

Turning to the ICC will be risky: Israel could retaliate, and Abbas could lose Western support and expose Hamas — with which he has been trying to reconcile — to the same charges.

Israel has long complained that it is unfairly singled out by what it sees as biased UN institutions and international bodies. It says that if standards were applied consistently, countries like the US, Britain, or Russia would also be called to task for their actions in places like Iraq and Ukraine.

Still, unlike in 2009, Israel appears to have decided not to boycott the Human Rights Council. Instead, it is vigorously mounting a defense, though it remains unclear to what extent it will cooperate with the probe.

“Now that the dust has cleared, we are doing the important work to document exactly what happened,” said government spokesman Mark Regev.

The Permanent Representative of Israel to the United Nations (UN) in Geneva, ambassador Eviatar Manor, attends an emergency session of the UN Human Rights Council on the Gaza crisis at the United Nations Offices in Geneva on July 23, 2014. (photo credit: Fabrice Coffrini/AFP)

The permanent representative of Israel to the United Nations in Geneva, ambassador Eviatar Manor, attends an emergency session of the UN Human Rights Council on the Gaza crisis, held at the UN offices in Geneva on July 23, 2014. (photo credit: AFP/Fabrice Coffrini)

Evidence collected includes video clips claiming to show rocket launches next to schools and mosques, “sensitive sites” that Israel decided not to attack and a Hamas training manual, allegedly captured in the fighting, instructing militants how to hide in civilian areas. The authenticity of the manual could not be independently verified.

A map distributed by the IDF depicts terror infrastructure in the Gaza City neighborhood of Shejaiya (Photo credit: IDF)

A map distributed by the Israel Defense Forces depicts terror infrastructure in the Gaza City neighborhood of Shejaiya. (photo credit: IDF)

Even during the fighting, the army says it had a team of legal experts reviewing operations, and often approving attacks after determining that they met international laws of war.

The military has launched an investigation into its wartime conduct headed by a major general and has brought in legal and military experts — who did not participate in the war themselves.

In a briefing with reporters this week, a senior intelligence official compared Hamas to a well-trained army, with some 16,000 soldiers and thousands of sophisticated weapons.

He said he was impressed by its tactics and organization.

An image provided by the IDF shows a mosque in Gaza which was targeted by an Israeli air strike on Friday night, July 11. The army says the holy site was used by terror groups to store weaponry. (Photo credit: IDF)

An image provided by the IDF shows a mosque in Gaza that was targeted by an Israeli airstrike on Friday night, July 11, 2014. The army says the holy site was used by terror groups to store weaponry. (photo credit: IDF)

Many of the group’s weapons were imported from abroad, while other locally made rockets used Iranian or Syrian “know-how.” He also showed off a glossy hardcover book, purportedly confiscated from a Hamas post, with in-depth details of the Israeli military’s units and commanders.

He spoke on condition of anonymity under military briefing guidelines.

The official said that Israel is conducting a painstaking process of trying to identify how many militants and how many civilians were killed. While Palestinians say roughly three-quarters of the dead were civilians, Israel says the balance is closer to half and half.

The official said Israel was certain 616 militants were killed. “We have the proof, the full names, certain that they are terrorists for sure,” he said. He added that it is certain that 706 civilians were killed — leaving 800 or so in question.

William Schabas, right, and members of a Serbian delegation at the International Court of Justice in The Hague, Netherlands in March. Schabas was named August 11 to head a UNHCR commission to look into war crimes during the Gaza conflict (photo credit: AP/Jiri Buller)

William Schabas (right), and members of a Serbian delegation at the International Court of Justice in The Hague, Netherlands, in March. Schabas was named August 11 to head a UNHCR commission to look into war crimes during the Gaza conflict. (photo credit: AP/Jiri Buller)

The official said Israel makes its determination by cross-checking the names issued by the Palestinian Health Ministry with other sources, including intelligence files, the Israeli military liaison body that deals with the Palestinians, as well as Palestinian hospitals and other sources.

He said all rulings require “at least two sources,” but that when the investigation is complete, he expects the ratio to remain the same.

The official added that compiling these figures is important for various reasons, including international opinion. “I have to say it very frankly, because it’s a big issue in the world,” he said.