Chinese President Xi Jinping has called for tougher sanctions against North Korea after he spoke by phone with German Chancellor Angela Merkel.
Her spokesman, Steffen Seibert, says both leaders advocated tougher sanctions against North Korea, but agreed that dialogue must continue to find a peaceful solution to the crisis.
China's state broadcaster, China Central Television, said Xi told Merkel that China remains committed to the denuclearisation of the Korean Peninsula and to the region's peace and stability.
Xi said: "Facts have repeatedly proven that the Korean Peninsula issue can only be resolved through peaceful means, including dialogue and consultation.
"This requires the international community to work together."
North Korea recently conducted its sixth and most powerful nuclear test.
Foreign Minister Wang Yi said China hopes North Korea will "see the situation clearly and come to the right judgment and choice".
He said the UN should take "necessary measures", but added that sanctions and pressure should spur dialogue and negotiation between the sides towards the goal of a peaceful solution on the Korean Peninsula.
US President Donald Trump said he hopes to avoid military action against North Korea but that military action is "certainly an option".
"It would be great if something else could be worked out," he told reporters during a joint news conference with Kuwaiti emir Sheikh Sabah Al-Ahmad Al-Jaber al-Sabah. "I would prefer not going the route of the military," Trump said. "If we do use it on North Korea, it will be a very sad day for North Korea.
"We will not be putting up with what's happening with North Korea," Trump said.
"We're going to see what happens."
Trump also said that North Korea "is behaving badly and it's got to stop".
Trump's comments were his most extensive public response to North Korea's statement on Sunday that it had tested its sixth nuclear device.
South Koreans told to avoid friction
South Korea has warned its citizens in China to avoid "friction" and "needless arguments" with Chinese people after the US military added more launchers to a contentious missile defence system in South Korea that Beijing opposes.
Seoul's Foreign Ministry spokesman Cho June-Hyuck said the message posted on the website of the South Korean Embassy in Beijing was aimed at protecting the safety of South Koreans in China.
Washington and Seoul say the Terminal High-Altitude Area Defence (Thaad) system allows South Korea and US troops stationed in the country to better cope with the threat of North Korean missiles.
But China has expressed anger over the deployment, saying that the system's powerful radar could peer deep into its territory and monitor its flights and missile launches.
South Korea has previously raised concerns over a reported ban on Chinese tour groups visiting the country in what many saw as Beijing's retaliation over the Thaad deployment. There have also been reports in past months about growing calls in China to boycott South Korean products and cancel appearances by South Korean pop singers or movie stars.
China backs UN action
"We believe that sanctions and pressure are only half of the key to resolving the nuclear issue. The other half is dialogue and negotiation. Only when the two are put together can it unlock the nuclear issue of the Korean Peninsula," Wang said.
China is a veto-wielding permanent member of the UN Security Council, as well as North Korea's main trading partner and source of food and fuel aid.
On Thursday, Chinese foreign ministry spokesman Geng Shuang reiterated China's opposition to South Korea's deployment of Thaad, which is intended to protect against North Korean missile attacks.
Two of the system's launchers are already operational, and the remaining four were added on Thursday amid protests by residents living near the site in South Korea.
Geng told reporters that China had complained to the US and South Korea and urged them to "take seriously the security concerns and interests of China and other regional countries". The US and South Korea should "immediately stop the deployment process and withdraw relevant equipment", Geng said.
China's opposition to the deployment has sent formerly strong relations with South Korea into a tailspin, cutting deeply into the crucial economic relationship between the two countries.
South Korean carmaker Hyundai Motor Co said its China plant halted operation because of a supply disruption on Tuesday, its second shutdown in China in less than a month.
China has not discussed military planning for a crisis on the Korean Peninsula with the US or others, but its defence ministry reported that the armed forces carried out drills in nearby waters two days after North Korea said it exploded a hydrogen bomb on Sunday.
The ministry said the exercise in the Bohai Gulf was aimed at "boosting the forces' expulsion mission capability" and not at any specific nations or targets, according to the ministry's official Sina Weibo microblog account. The ministry said the exercises had been planned well in advance. China has repeatedly said it will not tolerate an armed conflict on its doorstep and that there can be no military solution to tensions on the Korean Peninsula.
The Bohai Gulf lies just west of the Yellow Sea, which separates China from the Korean Peninsula.