HAMBURG, Germany — Wrapping up his second European tour, President Trump and Asian allies searched for consensus Saturday on how to counter what the president called the “menace” of North Korea after its test-launch of an intercontinental ballistic missile.

“Something has to be done about it,” Trump said as he met with Chinese President Xi Jinping. In a separate meeting with Japanese Prime Minister Shinzo Abe, Trump said the two were tackling “the problem and menace of North Korea.”

The White House said after the meeting with Abe that the U.S. was “prepared to use the full range of capabilities” in defense of Japan. Trump and Abe committed, the White House said, “to redoubling their efforts to bring all nations together to show North Korea that there are consequences for its threatening and unlawful actions.”

The Trump administration has tried to pressure Beijing to rein in North Korea, a major trading partner, to halt Kim Jong Un’s development of nuclear weapons before they have the ability to threaten the U.S. homeland. Trump has voiced his frustration in recent days that China hasn’t done more, suggesting he may be moving on.

But during his meeting, Trump told Xi, “I appreciate the things that you have done relative to the very substantial problem that we all face in North Korea.”

Trump’s extensive slate of meetings with Abe, Xi, British Prime Minister Theresa May and others came on the final day of the Group of 20 summit, which has been marked by violent demonstrations by anti-globalization activists.

Trump also had a brief, unscheduled meeting with Turkey’s President Recep Tayyip Erdogan about the situation in Syria.

Abe, speaking through a translator, noted that the security situation in the Asia Pacific region has become “increasingly severe” because of North Korea’s push to develop its ballistic missile and nuclear program. Abe said he wanted to “demonstrate the robust partnership as well as the bonds” between Japan and the U.S. on the issue.

North Korea’s successful test launch of an ICBM was a major milestone in its long-term effort to build a missile that could carry a nuclear warhead to attack the United States.

The issue was a frequent topic of discussion at the summit, and the White House said earlier that the U.S., South Korea and Japan were pressing for further measures against North Korea to demonstrate the “serious consequences” for its latest provocations.

The three nations have been calling for “early adoption” of a new U.N. Security Council resolution and further sanctions to demonstrate to Pyongyang the consequences of its actions.

Bringing China on board is a key part of the plan. The administration wants China to fully enforce international sanctions intended to starve Pyongyang of revenue for its nuclear and missile programs. But Trump has been dissatisfied with China’s response.

Earlier in the week, he vented on Twitter that trade between China and North Korea had grown nearly 40 percent at the start of 2017. “So much for China working with us – but we had to give it a try!”

Trump officials said later that the president hadn’t given up on the relationship.