The UN Security Council is scheduled to vote Thursday on a scandalous and irreversible Palestinian-led resolution purporting to decide that Israeli settlements violate international law.  All signs point to President Obama being a willing participant and refusing to exercise the American veto.

If adopted, the treacherous resolution will greenlight the boycott, divestment, sanctions “BDS” master plan to devastate the Israeli economy and fast-track the effort to send Israel’s Prime Minister to the International Criminal Court to stand trial for war crimes.

The Palestinians are in a hurry to capitalize on the deep-seated antipathy that President Obama has always had for Israel and its leaders, but occasionally repressed during election-cycles. Now an Obama foreign policy, with strong affinities for the UN mob, is unhinged.

Add to this toxic mix, Obama’s legacy problem. It turns out that a habit of systematically alienating America’s allies and coddling its enemies didn’t make the world a safer place.  In the Middle East, Obama has left us with the horrors of the Islamic State, 400,000 dead in Syria and millions of refugees, carnage in Yemen, deadly chaos in Libya, and ruthless crackdowns in Turkey. And then there is Obama’s Iran – the world’s leading state sponsor of terrorism now unabashedly enriching uranium, upgrading centrifuges, and testing ballistic missiles. Not to mention North Korean nuclear weapons testing, occupied Crimea, an aggressive China, and an active stone-age cult called Boko Haram.

With a mere four weeks to go until leaving office, the president has come up with a get-tough strategy. Slam Israel.

In some respects this plan has been ages in the making. For eight long years, the Palestinians have taken their cues from a President who continually took no for an answer.  They said no to a Jewish state, no to direct negotiations, no to ending incitement to terror, no to building homes rather than terror tunnels, no to stopping payments to the families of dead terrorists, no to teaching their youth tolerance instead of violent antisemitism, no to giving up the demand to return millions of Arabs to eradicate a Jewish state demographically, and no to co-habitating with Jews on Arab-claimed land.

And through it all, the message coming from the White House was that “settlements” – Jews living peaceful, productive lives on disputed territory whose ownership (by existing agreement) is to be determined through negotiations – are a fatal “obstacle to peace.”

As recently as December 4, 2016, Secretary Kerry told the Saban Forum in Washington, D.C., that settlements “are a barrier to peace and the right that supports it, openly supports it because they don’t want peace.”  Allegedly, mothers and fathers and brothers and sisters who for seven decades have had to live with the anguish of mandatory military service do not want peace.  Even non-deplorables would doubt that.  Or they might actually remember that Israelis have repeatedly been moved in advance of a negotiated end to hostilities by their own government for the sake of peace, only to have those hopes dashed time and again.

Moreover, seven decades of unremitting war and terror – that commenced the minute modern Israel was born – tell a different story.  Arab rejectionists consider all of Israel to be occupied territory and an illegal settlement from 1948 on.  Rolling back the clock to the 1967 borders is a way station. And a move back to indefensible borders – as Israelis have learned the hard way with their blood, sweat and tears.

If President Obama fails to veto the Palestinian resolution – while chuckling from the golf course in Hawaii – the consequences will be profound.

It will be a permanent outcome – the Russian and Chinese veto powers would prevent any effort to rescind it in the future by President Trump or any other president.

It will abandon long-standing bipartisan American foreign policy fundamentals that insist peace between Israelis and Arabs must come through direct negotiations – since such talks require each side to recognize and legitimize the other.

It will doom any prospect of negotiations for the foreseeable future.  Palestinians will have no incentive to negotiate since the UN gang will do their work for them.  And Israelis will have been double-crossed;  negotiated agreements can simply be “appealed” to the UN.

It will be a full-throated endorsement of BDS.  Why shouldn’t there be boycotts, divestment and sanctions of an illegal enterprise?

It will be a major incentive to the Prosecutor of the International Criminal Court to push forward with charges (already before her) that Israeli leaders are guilty of “war crimes” for supporting settlements.

Last Friday, President Obama made the preposterous claim that “almost every country on Earth sees America stronger and more respected today than they did eight years ago.”  Wounding the people of Israel, who courageously struggle against an implacable foe and yet long for peace with their neighbors, will earn him the respect of the thugs at the U.N., and a legacy of shame.