The U.N. General Assembly on Thursday overwhelmingly passed a measure rejecting the Trump administration's recognition of Jerusalem as Israel's capital, a stunning rebuke of a U.S. decision that allies and adversaries alike warned would undermine prospects for peace.

Despite U.S. threats to cut aid to countries that backed the resolution and even funding for the United Nations itself, 128 countries voted in favor of the measure. Only nine countries — including the United States and Israel — voted against it. Another 35 abstained, and 21 were absent.

The vote in a rare emergency session was a public reproach of an administration that stands alone in the world in recognizing Jerusalem as Israel's capital, a status other governments say should be left undecided until the final stage of talks between Israelis and Palestinians.

The nonbinding resolution on "illegal Israeli actions in occupied East Jerusalem and the rest of occupied Palestinian territory" declared actions that predetermine Jerusalem's fate "null and void." Even countries that abstained offered explanations that distanced themselves from President Trump's Dec. 6 decision.

The vote also underscored the apparent futility of the U.S. campaign to sway votes by threatening to cut funding, which some countries viewed as an effort to intimidate them into submission. Although Trump said Wednesday that he would be "watching" for countries that receive a lot of U.S. aid and voted "against us," the list of co-sponsors grew at the last minute to include Egypt and Jordan, the only two countries besides Israel that receive more than $1 billion in U.S. aid annually.

Nikki Haley, the U.S. ambassador to the United Nations, set the stage for a future showdown.

"The United States will remember this day in which it was singled out in this assembly for the very act of exercising our right as a sovereign nation," she said. "We will remember it when, once again, we are called up to make the world's largest contribution to the U.N., and we will remember it when many countries come calling on us to pay even more and to use our influence for their benefit."

Characterizing the United States as "disrespected," Haley said the U.S. Embassy will be moved to Jerusalem regardless.

"No vote in the United Nations is going to make any difference on that," she said. "But this vote will make a difference in how Americans look at the U.N. and how we look at countries that disrespect us at the U.N. And this vote will be remembered."

[U.S. threatens countries with loss of aid over U.N. vote on Jerusalem]

Although its significance is purely symbolic, the resolution carries political resonance, particularly in the Middle East, where the U.S. decision has sparked protests and drawn condemnation from Arab governments. Underscoring the U.S. isolation on the issue, even many allies have publicly appealed to the administration to reverse its position and leave Jerusalem's status undecided until Israelis and Palestinians negotiate terms.

On Monday, the United States exercised its Security Council veto to block the same resolution. All 14 other countries on the council, including U.S. allies Britain and France, supported the measure. Yemen and Turkey then submitted the resolution to the General Assembly, where the United States does not have veto power.

None of the countries that voted with the United States and Israel against the resolution are diplomatic powerhouses — Guatemala, Honduras, Togo and the Pacific island states of Micronesia, the Marshall Islands, Nauru and Palau. Among those voting in favor were Russia, China and several U.S. allies, notably Britain, France, Germany, Italy, Greece, Japan and Turkey. The abstaining nations included Canada, Mexico, Australia, Colombia, Haiti, Poland and the Philippines.

But many of the countries that abstained said they would keep their embassies in Tel Aviv. Many said they abstained because they thought the resolution did nothing to help push Israelis and Palestinians to negotiations toward a two-state solution.

"Mexico does not see it as positive or useful for a unilateral declaration to have taken place to recognize Jerusalem as the capital," said Mexico's ambassador, Juan José Gómez Camacho, adding that it was unnecessary to hold an emergency session to discuss the issue.

[Trump plan to move U.S. embassy to Jerusalem angers Middle East Christians]

Although the vote was lopsided, there were more abstentions than in at least five previous resolutions related to Israel and its conflict with the Palestinians. A spokesman for the U.S. mission to the United Nations attributed the shift to Haley's efforts, which included a warning that the administration would be "taking names" and a letter to ambassadors saying she would report the results to Trump.

"All of today's no votes, abstentions and no-shows were in solidarity with the U.S. position, which is a testament not only to those countries' priorities but also to the diplomatic outreach by Ambassador Haley and her team," the spokesman said.

Israeli Prime Minister Benjamin Netanyahu said in a statement that "Israel rejects the UN resolution and at the same time expresses satisfaction with the high number of countries that did not vote for the resolution."

"Israel thanks President Trump for his unambiguous position in favor of Jerusalem and thanks the countries that voted together with Israel, together with the truth," he said.

Palestinians exulted in the display of support at the United Nations. Palestine Liberation Organization Secretary General Saeb Erekat called the vote "evidence that the dignified world is united against intimidation and bullying."

Haley had watched with her arms crossed as Yemen's U.N. ambassador, Khaled Hussein Mohamed Alyemany, introduced the resolution and called Trump's action "a blatant violation of the rights of the Palestinian people and the Arab nations, and all Muslims and Christians of the world."

Some of the harshest criticism came from Turkey. "Mr. Trump, you cannot buy Turkey's democratic will with your dollars," President Recep Tayyip Erdogan tweeted before the debate.

Turkey's foreign minister, Mevlut Cavusoglu, spoke directly to the administration when he told the General Assembly: "We will not be intimidated. You can be strong, but this doesn't make you right."

In Jerusalem, however, there was relief that the Trump administration has Israel's back, even if the U.N. showdown accomplishes nothing.

"I think when the leader of the free world recognizes the history of Jerusalem, then it is meaningful, and in the long term it will make a big difference," said Jerusalem's mayor, Nir Barkat. "Clearly day-to-day, nothing will change. We will continue to build in the city; we will continue to uphold freedom of religion, freedom of movement and the status quo. These are things we do every day anyway.

"The show in the U.N., besides being shameful, proves that it is becoming less and less relevant from our perspective," he said.