Speaking to reporters at the end of the Nuclear Security Summit in Washington, President Obama on Friday gave a critical response to Republican presidential front-runner Donald Trump's recent remarks about nuclear weaponry.

Without referring to Trump by name, Mr. Obama said, "The person who made the statements doesn't know much about foreign policy, or nuclear policy, or the Korean Peninsula, or the world generally."

Trump this week said that Japan and South Korea might have to acquire their own nuclear weapons. In a separate incident this week, he refused to rule out using nuclear weapons in Europe if elected president.

All the while, leaders from more than 50 nations were gathering in Washington this week for the two-day Nuclear Security Summit with the primary intent of keeping nuclear materials out of the hands of terrorists.

Get Breaking News Delivered to Your Inbox

Mr. Obama said that Trump's remarks did come up "on the sidelines" of the summit.

"People pay attention to American elections," he said. "What we do is really important to the rest of the world. Even those countries that are used to a carnival atmosphere in their own politics want sobriety and clarity when it comes to U.S. elections because they understand the president of the United States needs to know what's going on around the world and has to put in place policies that not only lead to our security and prosperity but will have an impact on everybody else's security and prosperity."

The president noted that the United States' alliance with Japan and South Korea is the "cornerstone" of the United States' presence in the Asia-Pacific region.

"It has been an enormous boon to American commerce and American influence," he said, "and it has prevented the possibilities of a nuclear escalation and conflict between countries that in the past have been engaged in hugely destructive conflicts."

He added, "So you don't mess with that."

Catastrophes in the region have been avoided because of the sacrifices made by U.S. men and women during World War II and wise decisions made after that, Mr. Obama continued. "We don't want somebody in the Oval Office who doesn't recognize how important that is."