The 56-minute speech was a rebuke to the world body and a return to form for Trump, who routinely bashed the UN during his first term as president.
Leaders gave him polite applause when he exited the chamber.
He rejected moves by allies to endorse a Palestinian state amid Israel's latest Gaza offensive and urged European nations to adopt the same set of economic measures he is proposing against Russia to force an end to the war in Ukraine.
Much of his speech was dominated by two of his biggest grievances: immigration and climate change.
Trump offered his US immigration crackdown as a case study for what other world leaders should do to curb mass migration that he says is altering the fabric of nations.
Human rights advocates argue the migrants are seeking better lives.
"I'm really good at this stuff," Trump said.
"Your countries are going to hell."
Trump, who met last week with Britain's environmentally-conscious King Charles at Windsor Castle, called climate change a "con job" and urged a return to a greater reliance on fossil fuels.
Scientists say climate change caused by humans is real.
"Immigration and their suicidal energy ideas will be the death of Western Europe," Trump said.
Trump's administration plans to call for sharply narrowing the right to asylum at the United Nations later this month, Reuters reported last week, as it seeks to undo the post-World War Two framework around humanitarian protection.
Trump sprinkled into his speech a litany of false and misleading statements, such as that London Mayor Sadiq Khan wants to impose "sharia law" on London and that "inflation has been defeated" in the United States six days after the Federal Reserve said inflation has gone up.
European powers have spent months trying to stabilise their relationship with the US leader with a focus on winning US support to end the war in Ukraine. At a NATO summit in June, Trump and European leaders lavished each other with praise.
But in Tuesday's speech, Trump mocked NATO allies for not shutting down purchases of Russian oil and said he would impose strong economic measures against Moscow.
"They're funding the war against themselves. Who the hell ever heard of that one? In the event that Russia is not ready to make a deal to end the war, then the United States is fully prepared to impose a very strong round of powerful tariffs," he said.
"But for those tariffs to be effective, European nations, all of you are gathered here right now, would have to join us in adopting the exact same measures."
Trump later held talks with Ukrainian President Volodymyr Zelenskiy, who pressed for more US support to resist Russian advances. Trump, asked by reporters if NATO countries should shoot down Russian aircraft if they enter their airspace, said, "Yes, I do."
On the Israel-Palestinian conflict, Trump rejected efforts by world leaders to embrace a Palestinian state, a move that faces fierce resistance from Israel.
"The rewards would be too great for Hamas terrorists, for their atrocities," he said, repeating his call for the return of hostages taken by the Palestinian militant group.
Trump, who has cast himself as a peacemaker in a bid to win the Nobel Peace Prize, complained that the United Nations did not support his efforts to end conflicts around the world.
He added to his complaints with personal grievances about the UN infrastructure, saying he and first lady Melania Trump were briefly marooned on a malfunctioning UN escalator and that his teleprompter was not initially working.
"These are the two things I got from the United Nations - a bad escalator and a bad teleprompter," Trump said, noting that Melania Trump nearly fell when the escalator stopped abruptly.