The United Nations General Assembly voted overwhelmingly Thursday to repudiate President Trump's controversial declaration recognizing Jerusalem as the capital of Israel. Trump threatened to withhold aid in retaliation for a vote condemning his position.

The U.N. body voted 128-9 to declare Trump's recognition of Jerusalem as Israel’s capital "null and void." Thirty-five nations abstained.

The measure, drafted by U.S. ally Egypt, urges nations to support U.N. resolutions dating to 1967 — when Israel captured East Jerusalem from Jordan — that call for Jerusalem’s status to be decided through negotiations between Israelis and Palestinians.

Israel says a united Jerusalem will remain its capital, while Palestinians want it to cede East Jerusalem as the capital of a future, independent Palestinian state. Only a handful of countries recognize Jerusalem as the Israeli capital, while most others maintain embassies in Tel Aviv.

The resolution says “that any decisions and actions which purport to have altered, the character, status or demographic composition of the Holy City of Jerusalem have no legal effect, are null and void and must be rescinded in compliance with relevant resolutions of the Security Council.”

Trump warned Wednesday that the vote could impact “billions of dollars” in U.S. aid.

“Let them vote against us, we’ll save a lot,” Trump said. “We don’t care. This isn’t like it used to be where they could vote against you and then you pay them hundreds of millions of dollars and nobody knows what they’re doing.”

Americans are “tired of being taken advantage of” at the U.N. “and we’re not going to be taken advantage of any longer,” Trump said.

Turkey’s President Recep Tayyip Erdogan criticized Trump for threatening to cut off U.S. funding to countries that oppose his decision. “Mr Trump, you cannot buy Turkey’s democratic will with your dollars. Our decision is clear,” Erdogan said at a cultural awards ceremony in Ankara on Thursday.

U.S. Ambassador Nikki Haley said, “no vote in the United Nations will make any difference” on the U.S. decision to move its embassy to Jerusalem, which will go ahead because “it is the right thing to do.”

“We will remember it when we are called upon once again to make the world’s largest contribution to the United Nations,” Haley said. “And we will remember 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.”

Trump’s Dec. 6 announcement also said the State Department had been ordered to begin the years-long process of moving the U.S. Embassy to Jerusalem from Tel Aviv. Trump said the decision, following a law passed by Congress in 1998, does not impact the borders of Jerusalem, but reflected the reality that Israel considers the city its capital.

His announcement was widely condemned in capitals around the world, and provoked deadly protests in the Middle East.

More:U.S. vetoes U.N. resolution on Jerusalem

More:Jerusalem Palestinians still seek Israeli citizenship despite Trump declaration

More:Trump's Jerusalem plan signals to Palestinians — the less you give up, the more you lose

Thursday's vote at an emergency meeting of the General Assembly comes after the U.S. vetoed the same measure in the Security Council on Monday.

The remaining 14 Security Council members voted in favor of the resolution, including key U.S. allies such as Italy, Japan, Britain, France and Ukraine.

While the five permanent members of the Security Council — the United States, France, Britain, Russia and China — had veto power in the first vote, there are no vetoes at the General Assembly.

The General Assembly vote expresses widespread disapproval, however, it has little or no practical impact.