President Trump harshly criticized North Korea’s leader Kim Jong Un at the U.N. on Sept. 19, calling him “Rocket Man” and threatening to “totally destroy North Korea” if need be. (The Washington Post)

NEW YORK — President Trump warned the United Nations in a speech Tuesday that the world faces “great peril” from rogue regimes with powerful weapons and terrorists with expanding reach across the globe, and called on fellow leaders to join the United States in the fight to defeat what he called failed or murderous ideologies and “loser terrorists.”

“We meet at a time of immense promise and great peril,” Trump said in his maiden address to more than 150 international delegations at the annual U.N. General Assembly. “It is up to us whether we will lift the world to new heights or let it fall into a valley of disrepair.”

The president’s address was highly anticipated around the world for signs of how his administration would engage with the United Nations after he had criticized the organization during his campaign as being bloated and ineffective, and threatened to slash U.S. funding.

Trump offered a hand to fellow leaders but also called on them to embrace “national sovereignty” and to do more to ensure the prosperity and security of their own countries. Over and over, he stressed the rights and roles of “strong, sovereign nations” even as they band together at the United Nations.

“I will always put America first just like you, the leaders of your countries, should put your countries first,” Trump said, returning to a campaign theme and the “America First” phrase that has been criticized as isolationist and nationalistic.

The president warned of growing threats from North Korea and Iran, and he said, “The scourge of our planet is a group of rogue regimes.”

The North Korean delegation was seated, by chance, in the front row, mere feet from the U.N. podium.

Trump praised the United Nations for enacting economic sanctions on Pyongyang over its nuclear and ballistic missile tests. But he emphasized that if Kim Jong Un’s regime continued to threaten the United States and to destabilize East Asia, his administration would be prepared to defend the country and its allies.

“The United States has great strength and patience, but if it is forced to defend itself or its allies, we will have no choice but to totally destroy North Korea,” Trump said, before calling Kim by a nickname he gave the dictator on Twitter over the weekend. “Rocket Man is on a suicide mission for himself.”

Trump added, “If the righteous many do not confront the wicked few, then evil will triumph.”

Trump is scheduled to have a trilateral meeting Wednesday with Japanese Prime Minister Shinzo Abe and South Korean President Moon Jae-in to discuss the situation. He spoke separately with Chinese President Xi Jinping, who is not attending this year’s General Assembly.

Following the speech, White House press secretary Sarah Huckabee Sanders sought to temper the idea that Trump’s remarks about North Korea were a break from past U.S. policy.

Presidents have always been clear to deter threats: “We could, obviously, destroy North Korea with our arsenals” –@BarackObama last year

Trump also called the U.N.-backed Iran nuclear deal “one of the worst and most one-sided” agreements ever, and “an embarrassment” to the United States. His voice rising, Trump strongly hinted that his administration could soon declare Tehran out of compliance. That could potentially unravel the accord. Trump and his top aides have been critical of Iran for its support of terrorism in the Middle East.

“I don’t think you’ve heard the end of it,” Trump said.

Israeli Prime Minister Benjamin Netanyahu beamed as he and his wife, Sara, listened to Trump speak. The Israeli leader, an opponent of the international nuclear deal with Iran, was also addressing the world body later Tuesday, a day earlier than usual because he is leaving the gathering in time to spend the Jewish holy days in Israel.

“In more than 30 years of my acquaintance with the U.N., I have not heard a more courageous and sharp speech,” Netanyahu, a former Israeli ambassador to the body, said after Trump’s remarks. “President Trump told the truth about the dangers lurking in the world, and called to face them forcefully to ensure the future of mankind.”

In a meeting with media executives Tuesday shortly before Trump’s address, Iranian President Hassan Rouhani said Iran has complied fully with its commitments under the nuclear deal and predicted the United States will be the loser if it “tramples upon” the 2015 agreement.

“Everyone will clearly see that Iran has lived up to its agreements and that the United States is therefore a country that cannot be trusted,” Rouhani said.

“We will be the winners,” he added, while the United States “will certainly sustain losses.”

Rouhani also seemed to suggest a U.S. withdrawal would free Iran from its obligations under the deal, which lifted nuclear-related sanctions in exchange for limits on its nuclear program.

“It will mean that this agreement has seen a foundational problem, and under those conditions, Iran will be freed to choose another set of conditions,” he said.

In his speech, Trump pledged that his administration would support the United Nations in its goals of pursuing peace, but he was sharply critical of the organization, and its member nations, for not living up to the promise of its founding in 1945.

“We do not expect diverse countries to share the same cultures, values or systems of government,” he said. “But we do expect all nations to uphold their core sovereignty and respect the interests of their own people and rights of every other sovereign nation. This is the beautiful vision of this institution and the foundation for cooperation and success.”

The president also focused on the growing threats of “radical Islamic terrorism,” a phrase he had left out of other recent speeches, including a prime time address to the nation on his Afghanistan strategy. He declared that his administration would not allow “loser terrorists” to “tear up our nation or tear up the entire world.”

But Trump also cautioned that areas of the world “are in conflict and some, in fact, are going to hell.” He spent a portion of the speech decrying the “disastrous rule” of Venezuela’s Nicolás Maduro, whose authoritarian regime has sent the country into political and economic crisis.

“It is completely unacceptable and we cannot stand by and watch,” Trump said, calling on the United Nations to help the Venezuelan people “regain their freedom and recover their country and restore their democracy.”

He did not address some aspects of his foreign policy that have alarmed foreign leaders, including the proposed temporary ban on immigration for several Muslim-majority nations, a border wall with Mexico or the planned U.S. withdrawal from the Paris climate accord.

He appeared to answer international criticism of sweeping new restrictions on refugee resettlement by saying that the United States is helping refugees in other ways. Washington can help 10 people displaced in their home regions for the cost of moving one to the United States, Trump said.

Near the end of his remarks, Trump asked rhetorically: “Are we still patriots? Do we love our nations enough to protect their sovereignty and take ownership of their futures?”