“If the righteous many don’t confront the wicked few, then evil will triumph,” Mr. Trump said.

Mr. Trump emphasized that it was against the interest of the entire world for North Korea — which he called a “band of criminals” — to obtain missiles and nuclear weapons.

“Rocket man is on a suicide mission for himself,” he said of Mr. Kim.

Mr. Trump accused Mr. Kim of overseeing a regime that has starved its people, brutalized an imprisoned American college student who was returned home in a coma, and assassinated Mr. Kim’s older brother, a potential rival, with poison chemicals.

“If this is not twisted enough, now North Korea’s reckless pursuit of missiles and nuclear weapons threatens the entire world,” Mr. Trump said.

While he thanked Russia and China for supporting recent United Nations sanctions on North Korea, Mr. Trump also took an indirect swipe at them for continuing to do business with Mr. Kim.

“It is an outrage that some nations would not only trade with such a regime, but would arm, supply and financially support a country that imperils the world,” Mr. Trump said.

The president said that America would act alone if needed. He emphasized an “America first” agenda, and said that while the United States would “forever be a great friend to the world and especially to its allies,” his primary responsibility was to Americans.

“As president, I will always put America first, just like you as the leaders of your countries will always — and should always — put your countries first,” he said.

— MEGAN SPECIA