The UN General Assembly backed a resolution calling on the US to withdraw its recognition of Jerusalem as the capital of Israel.
Any decisions regarding the status of the city are "null and void" says the text of the resolution.
The vote took place even after the Trump administration threatened to cut aid to countries that supported the resolution.
The non-binding resolution was approved by 128 states, with 35 abstaining and 9 other voting against.
The countries that voted against the resolution were Israel, the United States, Micronesia, Marshall Islands, Nauru, Palau, Togo, Honduras, and Guatemala said an NBC article.
Among the 35 countries that abstained were Australia, Canada, Mexico, and Poland.
The UN Security Council tried to adopt a similar resolution but failed after the US vetoed the measure.
Turkish Foreign Minister Mevlut Cavusoglu posted a message on Twitter after the vote, praising the General Assembly for "showing common sense".
While Iran's Foreign Minister, Javad Zarif, tweeted the UN vote was a "resounding no" to Trump's threats.
A spokesperson for the US mission told NBC News that many countries prioritised their relationship with the United States over an unproductive attempt to isolate them for a decision that was their sovereign right to make.
Israeli Prime Minister Benjamin Netanyahu posted a message on Twitter thanking Trump and US ambassador Nikki Haley for their support.
“Israel completely rejects this preposterous resolution,” Netanyahu said in a video posted to Facebook. “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 theatre of the absurd. So I appreciate that, and especially I want to again express our thanks to (US) President (Donald) Trump and Ambassador (Nikki) Haley, for their stalwart defence of Israel and their stalwart defence of the truth.”
Watching the United Nations vote in the West Bank city of Ramallah was top Palestinian negotiator Saeb Erekat.
The vote to reject America’s recognition of Jerusalem as Israel’s capital is “historic,” Erekat said. “This is a day for peace, this is a day where the international community said the two state solution on the 1967 lines is doable – the state of Palestine with east Jerusalem as its capital to live side by side with the state of Israel in peace and security on the 1967 lines.”