This article was originally published by Gatestone Institute.

The US acted properly in vetoing a misguided UN Security Council resolution designed to undo President Donald Trump’s recognition of Jerusalem as Israel’s capital.

First, it is beyond the jurisdiction of the United Nations to tell a sovereign nation what it can and cannot recognize. If Turkey, for example, were to recognize East Jerusalem as the capital of “Palestine,” there is nothing the UN could or would do. (Of course, most UN members would applaud such a move.)

Second, the resolution fails to recognize that it was the December 2016 Security Council resolution — the one engineered by lame duck President Barack Obama — that changed the status of Jerusalem and complicated the efforts to achieve a compromise peace. Before that benighted resolution, Jerusalem’s Western Wall, the Jewish Quarter and the access roads to Hebrew University and Hadassah Hospital were widely recognized as part of Israel — or at worst, as disputed territory. Everyone knew that any peace agreement would inevitably recognize that these historically Jewish areas were an indigenous part of Israel. They were certainly not illegally occupied by Israel, any more than Bethlehem was illegally occupied by the Palestinian Authority (PA). Both Jerusalem and Bethlehem had originally been deemed part of an international zone by the United Nations when it divided the British mandate into two states for two people — a decision accepted by the Jews and rejected by all the Arab nations and the Palestinian Arabs in the area. Jordan then attacked Israel and illegally occupied the Western Wall and Jewish Quarter in Jerusalem, prohibiting any Jewish access to these holy areas, as well as to the university and hospital. Jordan also illegally occupied Bethlehem.

Related coverage On the Trail of Japanese Holocaust-Era Hero Chiune Sugihara A picturesque hilltop in the rustic countryside of central Japan’s Gifu Prefecture is the last place one might expect to...

In 1967, Jordan illegally attacked Israel. Jordan shelled civilian areas of Jerusalem. Israel responded and liberated the Western Wall, the Jewish Quarter and the access roads to Hebrew University and Hadassah Hospital, thereby opening these sites to everyone.

That has been the status quo for the last half century, until Obama engineered the notorious December 2016 Security Council resolution that declared the Western Wall, the Jewish Quarter and the access roads to be illegally occupied by Israel, thus changing the status quo. This unwarranted change — long opposed by United States administrations — made a negotiated peace more difficult, because it handed the Jewish holy places over to the Palestinians without getting any concessions in return, thus requiring that Israel “buy” them back in any negotiation. As the former prime minister of the Palestinian Authority once told me, “If we have the Wall, we will demand much to return it to Israel, because we know Israel will give much to get it.”

By declaring this disputed territory illegally occupied by Israel, the Security Council enabled the Palestinian Authority to hold the sites hostage during any negotiation. That vote changed the status quo more than the declaration by President Trump. The Trump declaration restored some balance that was taken away by the Obama-inspired Security Council resolution of a year ago.

Why did Obama change the status quo to the disadvantage of Israel? Congress did not want the change. The American people did not support the change. Many in the Obama administration opposed it. Even some members of the Security Council who voted for the resolution did not want the change. Obama did it as lame duck revenge against Prime Minister Benjamin Netanyahu, whom he hated. His motive was personal, not patriotic. His decision was bad for America, for peace and for America’s ally, Israel. He never would have done it except as a lame duck with no political accountability and no checks and balances.

Before that Security Council resolution changed the status quo, I did not support a unilateral recognition of Jerusalem by an American president, outside the context of a peace process. But once that resolution was passed and the status quo changed, I strongly supported President Trump’s decision to restore balance.

President Trump has been criticized for vetoing a resolution that has the support of every other Security Council member. That has been true of many anti-Israel Security Council and General Assembly resolutions. The United States often stands alone with Israel against the world, and the United States and Israel have been right. The bias of the international community against the nation state of the Jewish people has been long-standing and evident, especially at the United Nations. Abba Eban made the point years ago when he quipped that if Algeria presented a resolution that the earth was flat and Israel flattened it, the vote would be 128 in favor, 3 opposed and 62 abstentions. Recall the infamous UN General Assembly resolution declaring Zionism to be a form of racism. It received overwhelming support from the tyrannical nations of the world, which constitute a permanent majority of the United Nations, and was rescinded only after the United States issued threats if it were to remain on the books.

This entire brouhaha about Jerusalem — including the staged tactical violence by Palestinians — is entirely the fault of a single vengeful individual who put personal pique over American policy: Barack Obama.

Alan M. Dershowitz, is the Felix Frankfurter Professor of Law, Emeritus, at Harvard Law School and author of, “Trumped Up! How Criminalization of Political Differences Endangers Democracy,” which is now available. Follow Dershowitz on Twitter and Facebook.