The UN General Assembly voted 128-9 on Thursday in favor of a resolution condemning President Trump’s recognition of Jerusalem as the capital of Israel. There were 35 abstentions.

Under the nonbinding measure, any decision to change the status of Jerusalem is null and void, has no legal effect and must be rescinded. It also calls on member countries not to set up diplomatic missions in Jerusalem.

A spokesman for Palestinian President Mahmoud Abbas called the vote “a victory for Palestine,” while Israeli Prime Minister Benjamin Netanyahu said he “completely rejects this preposterous resolution.”

“Jerusalem is our capital. Always was, always will be. But I do appreciate the fact that a growing number of countries refuse to participate in this theater of the absurd,” he said in a video posted on Facebook.

“So I appreciate that, and especially I want to again express our thanks to President Trump and [UN] Ambassador [Nikki] Haley for their stalwart defense of Israel and their stalwart defense of the truth.”

Haley was defiant ahead of the vote, insisting that the US would move its embassy from Tel Aviv to Jerusalem no matter how the vote turned out.

“No vote in the UN will make any difference on that,” she said.

In addition to the US and Israel, Guatemala, Honduras, Marshall Islands, Micronesia, Nauru, Palau and Togo voted against the resolution.

Among the countries that voted in favor were India, Russia and China. Abstaining nations included Canada, Mexico, Australia, Poland, Hungary, Croatia and the Czech Republic.

Trump’s threat this week to cut off US funding to countries that oppose his Dec. 6 decision — which reversed decades of US policy and sparked violent protests across Israel and the rest of the world — appeared to have had an impact.

Support for the resolution among the General Assembly’s 193 members was lower than its supporters hoped for, with many predicting at least 150 “yes” votes, CBS News reported.

Among the countries that voted for the measure were Egypt and Jordan, which, according to The Washington Post, are the only two countries besides Israel that receive more than $1 billion in US aid annually.

The vote followed stinging words from Haley, who reminded the assembly that the US was “by far the single largest contributor to the UN” and warned that the US might also cut funding to the world body itself.

“We’ll be honest with you, when we make generous contributions to the UN, we also have a legitimate expectation that our goodwill is recognized and respected,” Haley said.

“The United States will remember this day in which it was singled out for attack in the General Assembly for the very act of exercising our right as a sovereign nation,” she added.

“We will remember it when we are called upon to once again make the world’s largest contribution to the United Nations, and we will remember it when so many countries come calling on us, as they so often do, to pay even more and to use our influence for their benefit.”

The resolution went to the assembly after the US vetoed it at the Security Council on Monday, although all other 14 council members voted in favor.

Netanyahu blasted the UN earlier in the day as a “house of lies,” saying Israel “rejects outright this vote, even before it passes.”

At the assembly, Israeli UN Ambassador Danny Danon held up a coin that he said dated to 67 AD and bore the words, in Hebrew, “Freedom of Zion.”

He called the coin “clear evidence . . . that proves the ancient connection of Jews to Jerusalem,” CBS reported.

Israel, which captured the eastern part of Jerusalem in the 1967 Six-Day War, considers the city to be its eternal, undivided capital.

Palestinians want to make East Jerusalem the capital of a future Palestinian state.