President Trump’s decision to recognize Jerusalem as Israel’s capital is a perfect response to former President Barack Obama’s benighted decision to change American policy by engineering the United Nations Security Council resolution declaring Judaism’s holiest places in Jerusalem to be occupied territory and a “flagrant violation under international law.” It was Obama who changed the status quo and made peace more difficult, by handing the Palestinians enormous leverage in future negotiations and disincentivizing them from making a compromised peace.

It had long been American foreign policy to veto any one-sided Security Council resolutions that declared Judaism’s holiest places to be illegally occupied. Obama’s decision to change that policy was not based on American interests or in the interests of peace. It was done out of personal revenge against Prime Minister Netanyahu and an act of pique by the outgoing president. It was also designed improperly to tie the hands of President-elect Trump. President Trump is doing the right thing by telling the United Nations that the United States now rejects the one-sided Security Council resolution.

So if there is any change to the status quo, let the blame lie where it should be: at the hands of Obama for his cowardly decision to wait until he was a lame-duck president to get even with Prime Minister Netanyahu. Trump deserves praise for restoring balance in negotiations with Israel and the Palestinians. It was Obama who made peace more difficult. It was Trump who made it more feasible again.

The outrageously one-sided Security Council resolution declared that “any changes to the 4 June 1967 lines, including with regard to Jerusalem,” have “no legal validity and constitutes a flagrant violation under international law.” This means, among other things, that Israel’s decision to build a plaza for prayer at the Western Wall — Judaism’s holiest site — constitutes a “flagrant violation of international law.” This resolution was, therefore, not limited to settlements in the West Bank, as the Obama administration later claimed in a bait-and-switch. The resolution applied equally to the very heart of Israel.

Before June 4, 1967, Jews were forbidden from praying at the Western Wall, Judaism’s holiest site. They were forbidden to attend classes at the Hebrew University at Mt. Scopus, which had been opened in 1925 and was supported by Albert Einstein. Jews could not seek medical care at the Hadassah Hospital on Mt. Scopus, which had treated Jews and Arabs alike since 1918. Jews could not live in the Jewish Quarter of Jerusalem, where their forbearers had built homes and synagogues for thousands of years.

These Judenrein prohibitions were enacted by Jordan, which had captured by military force these Jewish areas during Israel’s War of Independence, in 1948, and had illegally occupied the entire West Bank, which the United Nations had set aside for an Arab state. When the Jordanian government occupied these historic Jewish sites, they destroyed all the remnants of Judaism, including synagogues, schools, and cemeteries, whose headstones they used for urinals. Between 1948 and 1967, the United Nations did not offer a single resolution condemning this Jordanian occupation and cultural devastation.

When Israel retook these areas in a defensive war that Jordan started by shelling civilian homes in West Jerusalem, and opened them up as places where Jews could pray, study, receive medical treatment and live, the United States took the official position that it would not recognize Israel’s legitimate claims to Jewish Jerusalem.

It stated that the status of Jerusalem, including these newly liberated areas, would be left open to final negotiations and that the status quo would remain in place. That is the official rationale for why the United States refused to recognize any part of Jerusalem, including West Jerusalem, as part of Israel. That is why the United States refused to allow an American citizen born in any part of Jerusalem to put the words “Jerusalem, Israel” on his or her passport as their place of birth.

But even that ahistoric status quo was changed with Obama’s unjustified decision not to veto the Security Council Resolution from last December. The United Nations all of the sudden determined that subject to any further negotiations and agreements, the Jewish areas of Jerusalem recaptured from Jordan in 1967 are not part of Israel. Instead, they were territories being illegally occupied by Israel, and any building in these areas — including places for prayer at the Western Wall, access roads to Mt. Scopus, and synagogues in the historic Jewish Quarter — “constitutes a flagrant violation under international law.” If that indeed is the new status quo, then what incentives do the Palestinians have to enter negotiations? And if they were to do so, they could use these Jewish areas to extort unreasonable concessions from Israel, for which these now “illegally occupied” areas are sacred and non-negotiable.

Obama’s refusal to veto this one-sided resolution was a deliberate ploy to tie the hands of his successors, the consequence of which was to make it far more difficult for his successors to encourage the Palestinians to accept Israel’s offer to negotiate with no preconditions. No future president can undo this pernicious agreement since a veto not cast can never be retroactively cast. And a resolution once enacted cannot be rescinded unless there is a majority vote against it, with no veto by any of its permanent members, which include Russia and China, who would be sure to veto any attempt to undo this resolution.

Trump’s decision to officially recognize Jerusalem as Israel’s capital helps to restore the appropriate balance. It demonstrates that the United States does not accept the Judenrein effects of this bigoted resolution on historic Jewish areas of Jerusalem, which were forbidden to Jews. The prior refusal of the United States to recognize Jerusalem as Israel’s capital was based explicitly on the notion that nothing should be done to change the status quo of that city, holy to three religions. But the Security Council resolution did exactly that. It changed the status quo by declaring Israel’s de facto presence on these Jewish holy sites to be a “flagrant violation under international law” that “the U.N. will not recognize.”

Since virtually everyone in the international community acknowledges that any reasonable peace would recognize Israel’s legitimate claims to these and other areas in Jerusalem, there is no reason for allowing the U.N. resolution to make criminals out of every Jew or Israeli who sets foot on these historically Jewish areas. (Ironically, Obama prayed at what he regarded as the illegally occupied Western Wall.)

After the United Nations, at the urging of Obama, made it a continuing international crime for there to be any Israeli presence in disputed areas of Jerusalem, including areas whose Jewish provenance is beyond dispute, Trump was right to untie his own hands and to undo the damage wrought by his predecessor. Some have argued that the United States should not recognize Jerusalem because it will stimulate violence by Arab terrorists.

No American decision should ever be influenced by the threat of violence. Terrorists should not have a veto over American policy. If the United States were to give in to threat of violence, it would only incentivize others to threaten violence in response to any peace plan. So let’s praise Trump for doing the right thing by undoing the wrong thing Obama did at the end of his presidency.

Alan Dershowitz (@AlanDersh) is a contributor to the Washington Examiner's Beltway Confidential blog. He is the Felix Frankfurter Professor of Law, Emeritus, at Harvard Law School and author of "Trumped up! How Criminalizing Politics is Dangerous to Democracy." This article was originally published by The Hill.

If you would like to write an op-ed for the Washington Examiner, please read our guidelines on submissions here.