Washington must stop the United Nations’ attempt to criminalize Israel’s war on terror not only because it’s the right thing to do — but because America’s military may well be next in its crosshairs.

On Monday, the UN’s Human Rights Council issued a lengthy report on last summer’s war in Gaza. Written by a team led by retired New York Supreme Court judge Mary McGowan Davis, it’s bedtime reading in the Hague, the seat of the International Criminal Court.

The reality of the report is that it is, unlike past such reports, a road map for the International Criminal Court’s prosecutor to indict Jerusalem officials and the brass of the Israel Defense Forces, now that the Palestinian Authority has joined the ICC.

And sure enough, a Palestinian official filed an official ICC complaint against Israel Thursday, based on some of the rights council’s findings.

Hamas is euphemized as “armed Palestinian groups.” But the report’s authors specifically accuse “decision-makers at the highest levels of the Government of Israel” of possible responsibility for war crimes. And not just Prime Minister Benjamin Netanyahu; midlevel IDF officers are also mentioned by name.

The report all too conveniently concludes that Israel’s judicial system isn’t adequate, so off to the Hague we go.

And here’s the view from The Hague. In 2009, the ICC indicted a true war criminal, Sudanese tyrant Omar al-Bashir, but is yet to bring him to justice.

In the latest twist, South Africa, an early enthusiastic supporter of the ICC, hosted Bashir last week. Pretoria then allowed him to quietly fly back home, defying a local court order — not to mention the ICC’s request that all its members do their utmost to arrest Bashir and transfer him to The Hague.

Why? Pretoria listens to African leaders who complain that since the ICC’s establishment in 1998, it’s only prosecuted Africans. Bring us a case against some non-African they say, or we’re outta here.

That’s a political conundrum for the ICC, which can quickly lose its image as a world judiciary body: It’s membership is already thin, as Russia, China, India and (most importantly) America decline membership.

If Africans quit now too, who’d take the ICC seriously? To the rescue, here comes the UNHRC.

Until two years ago, the ICC couldn’t touch the IDF, because Israel isn’t a member. But now “Palestine” was admitted as a member so, voila, any crime committed in the territory of that “state” — including Gaza — is fair game.

But wait, did the IDF actually commit war crimes by neglecting to protect innocents, as the McGowan Davis report argues? Military professionals beg to differ.

In Gaza “Israel went to extraordinary lengths to limit collateral damage and civilian casualties,” the chairman of the US Joint Chiefs of Staff, General Martin Dempsey, said last November.

This month, a group of European, American and other former military commanders investigated the war and insisted they’d never heard of “any army that takes such extensive measures as did the IDF last summer to protect the lives of the civilian population.”

Such testimony indicates that Israel’s asymmetric war against terrorism differs little from NATO’s or other armies’. And guess what: there’s already a small pile on ICC prosecutor Fatou Bensouda’s desk filled with complaints of alleged US crimes in Afghanistan and Iraq. What if she or her successor decide to go after those cases?

Any American commander in chief must consider such a possibility. Yes, the Geneva Conventions and other half-century-old treaties governing war must be updated to fit the current battlefield, where terrorists revel in killing enemy and allied civilians alike.

But more importantly, President Obama must consider disavowing and defunding biased, purely political bodies like the Human Rights Council, and warn UN Secretary-General Ban Ki-moon that other UN bodies are next. America shouldn’t get anywhere near the ICC either, at least not until it conclusively proves that law, rather than global politics, guides its decisions.

It won’t happen, of course, so the next president must weigh those options. Otherwise, he or she risks being indicted by one global kangaroo court or another.