President Donald Trump offered a broad condemnation of globalism at the United Nations on Tuesday, saying that the United States would protect its sovereignty and national interests — and that the other countries of the world should do the same.

"We reject the ideology of globalism and we embrace the doctrine of patriotism," the president said during wide-ranging remarks that began with a stump-like recitation of his domestic accomplishments, included an announcement of new sanctions against Venezuela, and covered his reasons for pulling the U.S. out of the U.N. Human Rights Council and its global compact on migration.

"Migration should not be governed by an international body unaccountable to our own citizens," Trump said.

Trump got off to an inauspicious start when he boasted about his presidency.

"In less than two years, my administration has accomplished more than almost any administration in the history of our country," Trump said, eliciting laughter from some of those in attendance.

"Didn't expect that reaction, but that's OK," he responded.

Later, he told reporters that his assessment of his administration's success was supposed to be a laugh line.

"Oh it was great, that was meant to get some laughter," he said. "But it was great."

In aggrieved tones in his address, Trump accused foreign countries, including China, of cheating the United States in trade deals and taking advantage of American protection to keep down their own defense budgets. And Trump said the U.S. would provide financial assistance only to those nations that already are acting in America's interests.

"The United States is the world’s largest giver in the world, by far, of foreign aid, but few give anything to us," he said. "We will examine what is working, what is not working, and whether the countries who receive our dollars and our protection also have our interests at heart. Moving forward, we are only going to give foreign aid to those who respect us, and frankly, are our friends."

A year after calling North Korean leader Kim Jong-un "little rocket man" from the U.N. lectern, Trump thanked Kim for working with the U.S. to return American hostages and the remains of soldiers killed in the Korean conflict. But, he said, U.S. sanctions on North Korea "will stay in place until denuclearization occurs."

The president also threatened that "the United States will respond" if chemical weapons are used in Syria, bashed Venezuelan President Nicolas Maduro and detailed U.S. efforts to ramp up sanctions on Iran after he withdrew America from a nuclear agreement with Tehran.

In an exchange with reporters after his speech, Trump expressed hope that the U.S. relationship with Iran could eventually follow the same trajectory as its relationship with North Korea — where the prospect of sanctions relief has led Pyongyang to discuss ending its nuclear program.