The highest-ranking US military officer has said that Israel went to "extraordinary lengths" to limit civilian casualties in the recent war in Gaza that killed hundreds of Palestinians, mostly civilians.

Army General Martin Dempsey, the chairman of the Joint Chiefs of Staff, acknowledged recent reports criticising civilian deaths during the 50-day Gaza war this year but told an audience in New York on Thursday he thought the Israel Defence Forces "did what they could" to avoid civilian casualties.

Israel was criticised for civilian deaths during the conflict, including by the White House. More than 2,100 Palestinians were killed during the fighting, most of them civilians and many of them children, according to UN and Palestinian figures.

A Human Rights Watch report in September accused Israel of committing war crimes by attacking three UN-run schools in the enclave, while Amnesty International said in a report released on Wednesday that Israel showed "callous indifference" to the carnage caused by attacks on civilian targets.

Dempsey was asked about the ethical implications of Israel's handling of the Gaza war, during an appearance in New York at the Carnegie Council for Ethics in International Affairs.

"I actually do think that Israel went to extraordinary lengths to limit collateral damage and civilian casualties," Reuters news agency reported Dempsey as telling the gathering.

"In this kind of conflict, where you are held to a standard that your enemy is not held to, you're going to be criticised for civilian casualties," he added.

Dempsey said Hamas had turned Gaza into "very nearly a subterranean society" with tunneling throughout the coastal enclave.

"That caused the IDF some significant challenges. But they did some extraordinary things to try and limit civilian casualties, to include ... making it known that they were going to destroy a particular structure," Dempsey said.

The general said civilian casualties during the conflict were "tragic, but I think the IDF did what they could" to avoid them.