The 193-member General Assembly adopted the resolution by 128 to nine with 35 abstentions, in what Palestinian UN envoy Riyad Mansour called a "massive setback" for the United States.
An additional 21 countries did not turn up for the vote including Ukraine, which had supported the same resolution in the Security Council, indicating the US threats did have a chilling effect on some governments.
Guatemala, Honduras, Israel, the Marshall Islands, Micronesia, Nauru, Palau and Togo joined the United States in opposing the measure.
Among the countries that abstained were Argentina, Australia, Canada, Croatia, the Czech Republic, Hungary, Latvia, Mexico, the Philippines, Poland, Romania and Rwanda.
Speaking at the emergency session, US Ambassador Nikki Haley warned the United States "will remember this day."
"America will put our embassy in Jerusalem," Haley said in defense of the US move, which broke with international consensus and unleashed protests across the Muslim world.
"No vote in the United Nations will make any difference on that," Haley said. "But this vote will make a difference on how Americans look at the UN and on how we look at countries who disrespect us in the UN."
"When we make generous contributions to the UN we also have a legitimate expectation that our goodwill is recognized and respected," she said.
The resolution reaffirms that the status of Jerusalem must be resolved through negotiations, and that any decision reached outside of that framework must be rescinded.
Without explicitly referencing the US move, it "affirms 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."
Turkish President Recep Tayyip Erdogan said the vote showed the "illegality" of Trump’s decision, urging the United States to withdraw it.
The motion was sent to the General Assembly after it was vetoed by the United States at the Security Council on Monday, although all other 14 council members voted in favor.
While resolutions by the General Assembly are non-binding, a strong vote in support carries political weight.
Ahead of the vote, Israel’s Prime Minister Benjamin Netanyahu blasted the UN as a "house of lies," saying Israel "rejects outright this vote, even before it passes."
"No General Assembly resolution will ever drive us from Jerusalem," vowed Israeli Ambassador Danny Danon.
Palestinian foreign minister Riad al-Malki called the vote an "unprecedented test" for the UN, and referenced the US warning that it was "taking names."
"History records names, it remembers names -- the names of those who stand by what is right and the names of those who speak falsehood," al-Malki said.
Trump’s decision on December 6 to recognize Jerusalem as Israel’s capital prompted a flurry of appeals to the United Nations.
The status of the Holy City is one of the thorniest issues in the Israeli-Palestinian conflict.
Trump warned that Washington would closely watch how nations voted, suggesting there could be reprisals for those that back the motion put forward by Yemen and Turkey on behalf of Arab and Muslim countries.
"They take hundreds of millions of dollars and even billions of dollars and then they vote against us," Trump said.
"Well, we’re watching those votes. Let them vote against us. We’ll save a lot. We don’t care."
’House of lies’
The resolution mirrored the text that was vetoed at the Security Council on Monday, and although it does not mention Trump’s decision, it expresses "deep regret at recent decisions" concerning the city’s status.
No country has veto powers in the General Assembly, unlike in the 15-member Security Council where the United States, along with Britain, China, France and Russia, can block any resolution.
UN diplomats privately said the United States had succeeded in making some countries think twice.
Haley tweeted that 65 countries had "refused to condemn the United States" over its decision on Jerusalem - a tally of "no" votes, abstentions and no-shows.
"While the resolution passed, the vote breakdown tells a different story," said a spokesperson for the US mission.
"It’s clear that many countries prioritized their relationship with the United States over an unproductive attempt to isolate us for a decision that was our sovereign right to make."
The Palestinian ambassador insisted the vote was more about Trump’s foreign policy approach than the status of Jerusalem.
"They made it about them," said Mansour. "They did not make it about Jerusalem, so when you make it about them and to only be able to get nine votes to say ’no’ to it, I think it was a complete failure for their campaign."
Israel seized the largely-Arab eastern sector of Jerusalem during the 1967 Six-Day War and later annexed it, claiming both sides of the city as its "eternal and undivided capital."
But the Palestinians want the eastern sector as the capital of their future state and fiercely oppose any Israeli attempt to extend sovereignty there. Source from VNS