Shima, Japan: President Barack Obama said Thursday that foreign leaders are “rattled” by Donald Trump and have good reason to feel that way, as he accused the presumptive Republican presidential nominee of ignorance about world affairs.

Weighing in on the Democratic race to replace him, Obama also downplayed concerns that the protracted fight between Hillary Clinton and Bernie Sanders is hurting his party’s chances, brushing off their escalating attacks as the inevitable “grumpiness” of a primary campaign.

Obama offered his assessment of the presidential campaign on the sidelines of a Group of Seven advanced economies summit in Japan, the latest world gathering to be colored by global concerns about Trump. Obama said foreign leaders at the conference were unsure how seriously to take his pronouncements.

“They are rattled by it ‑ and for good reason,” Obama said. “Because a lot of the proposals he has made display either ignorance of world affairs, or a cavalier attitude, or an interest in getting tweets and headlines.”

He contrasted that to proposals that thoughtfully address what’s required to keep the US safe and prosperous and “to keep the world on an even keel.”

Questions about the unpredictable Trump have increasingly trailed Obama when he travels overseas, with world leaders incredulously sizing up a leading presidential candidate who speaks of banning Muslim immigration, starting trade wars and spreading nuclear weapons to Japan and South Korea. Obama has said that Trump now comes up in every one of his foreign meetings, with the president offering reassurances that he doesn’t believe Trump will be elected.

Though Obama has generally avoided opining on the presidential race, particularly while the Democratic primary continues to play out, he’s made no secret of his distaste for Trump, whose election would mark a sharp departure from Obama in both tone and substance.

In addition to opposing the sweeping Asia-Pacific free trade deal that Obama brokered, Trump has threatened to renegotiate Obama’s nuclear deal with Iran and the global climate pact reached in Paris.

Obama, taking questions the day before he pays a historic visit to Hiroshima, said foreign countries pay more attention to US elections than Americans do to theirs because they count on the U.S. to provide stability and direction in addressing global challenges.

“I think it’s fair to say they are surprised by the Republican nominee,” Obama said, referring to Trump.

Yet Obama brushed off calls for him to get more personally involved in brokering a resolution, saying that he’s still inclined to let the Democratic primary play itself out. He likened the hard-fought campaign between Clinton and Sanders to the one he waged with Clinton in 2008.

Taliban leadership

Asked about the Taliban’s new leader, Obama said he was not optimistic about a change for the better any time soon despite the US drone strike that killed former Taliban chief Mullah Akhtar Mansour, who had refused to engage in reconciliation talks with Afghanistan’s government.

Mansour’s replacement, Mullah Haibatullah Akhundzada, has signaled intentions to continue Mansour’s aggressive approach. But Obama said he never expected “a liberal Democrat” to be the newly appointed leader of the Taliban.

“In the short term, we anticipate the Taliban will continue to pursue an agenda of violence,” Obama said.

He added that he was hopeful that eventually “when there are those within the community that surround the Taliban that recognize their goals are best achieved by negotiations.”

Maritime disputes

Obama also called on China to resolve maritime disputes peacefully and he reiterated that the United States was simply concerned about freedom of navigation and overflight in the region.

Obama on Thursday pointed to the risks from North Korea’s nuclear and missile programmes, saying the isolated state was “hell bent” on getting atomic weapons.

But he said there had been improved responses from countries in the region like China that could reduce the risk of North Korea selling weapons or nuclear material.

“It’s something that we’ve put at the centre of discussions and negotiations with China,” Obama said.