President Barack Obama criticized Republican frontrunner Donald Trump, saying he “doesn’t know much about foreign policy, or nuclear policy, or the Korean Peninsula, or the world generally.”

The president made his remarks during a press conference at the end of the Nuclear Security Summit in Washington D.C.

He said that Trump’s recent comments about Japanese and Korean nuclear force had come up on the sidelines of the nuclear talks by world leaders.

On Tuesday, Trump told CNN that “Japan is better if it protects itself against this maniac of North Korea … We are better off frankly if South Korea is going to start protecting itself … they have to protect themselves or they have to pay us.”

“People pay attention to American elections,” Obama said Friday. “What we do is really important to the rest of the world and even in those countries that are used to a carnival atmosphere in their own politics want sobriety and clarity when it comes to U.S. elections.”

Obama praised the relationship with South Korea and Japan, pointing out that it was a “cornerstone” of the United States presence in the Asia-Pacific region, which prevented nuclear escalation.

“So you don’t mess with that,” Obama advised. “We don’t want somebody in the Oval office who doesn’t recognize how important that is.”