Secretary of State Rex Tillerson shakes hands with Chinese State Counselor Yang Jiechi on Saturdady in Beijing. (Reuters)

China urged the United States to remain “coolheaded” over North Korea and not to turn its back on dialogue, as visiting Secretary of State Rex Tillerson expressed a “sense of urgency” to curb dangerous levels of tension on the Korean Peninsula.

On his first trip to Asia this week, Tillerson earlier declared that diplomacy has failed to persuade North Korea to abandon its nuclear program and that a new approach was needed. On Friday in Seoul, he warned ominously that all options were on the table to counter the threat from Pyongyang.

President Trump weighed in Friday by goading China over Twitter for not doing enough to help prevent its ally from “behaving very badly.”

But in a joint news conference Saturday with his Chinese counterpart, Tillerson struck a more diplomatic note, choosing to play down differences with Beijing and affirm that both countries share the goal of a denuclearized Korean Peninsula.

“We share a common view and a sense that tensions on the peninsula are quite high right now and that things have reached a rather dangerous level, and we’ve committed ourselves to doing everything we can to prevent any type of conflict from breaking out,” Tillerson said.

Chinese Foreign Minister Wang Yi agreed, adding a note of advice for Tillerson.

“No matter what happens, we have to stay committed to diplomatic means as a way to seek peaceful settlement,” Wang said. “We hope all parties, including our friends from the United States, could size up the situation in a coolheaded and comprehensive fashion, and arrive at a wise decision,” he said.

In February, China suspended coal imports from North Korea for the rest of the year, a move that cuts off the regime’s major financial lifeline. Wang pledged to maintain U.N. sanctions on North Korea but said that Security Council resolutions also included “clear provisions for efforts to resume talks to de-escalate the tension and to safeguard stability on the peninsula.”

North Korea has amassed a sizable nuclear stockpile and appears on the brink of being able to strike the U.S. mainland and American allies in Asia. The situation has emerged as a major, early foreign-policy test for the Trump administration.

Tillerson said China and the United States felt “a certain sense of urgency” in trying to persuade Pyongyang to “make a course correction” and abandon its nuclear weapons program.

In Seoul on Friday, Tillerson said the Trump administration was exploring an array of diplomatic, economic and security measures to put more pressure on North Korea — including tighter sanctions — and that although a military response was possible if the threat from Pyongyang’s missile program were to grow, “we have many, many steps we can take before we get to that point.”

Previous efforts to offer carrot-and-stick diplomacy to North Korea have failed, beginning with a 1994 deal under which Pyongyang would have received aid and two proliferation-resistant nuclear power plants in return for freezing and eventually dismantling its nuclear weapons program.

That deal collapsed in 2002, and North Korea completed its first atomic test in 2006. The George W. Bush administration’s efforts at a new deal collapsed, and Pyongyang has managed to build up its stockpile and refine its missiles despite what on paper look like crushing international sanctions.

But even faced with the failure of previous talks and North Korea’s chronic inability to keep previous promises, China insists that dialogue remains the only option.

It has proposed a deal whereby the United States suspends its annual military exercises with South Korea in return for North Korea’s suspending its nuclear program, but Washington has already rejected the idea, saying it first needs to see positive action from Pyongyang.

Wang said tensions had risen precisely because talks had broken down, and he urged all sides to get back to the negotiating table.

Overall, though, Tillerson and Wang tried to strike a positive tone, repeating the reassuring mantra that U.S.-China relations were founded on the principles of avoiding conflict and confrontation, and promoting mutual respect and “win-win cooperation” — far from the sort of language Trump employed on the campaign trail.

Wang called their talks “candid, pragmatic and productive,” and Tillerson talked about a “constructive and results-oriented relationship.”

The secretary of state also talked of a trading relationship that is “fair and pays dividends both ways,” made a glancing reference to the countries’ maritime disputes, and said the United States would continue to “advocate for universal human rights and religious freedom.”

The two men also said they were working toward a face-to-face meeting between Trump and President Xi Jinping to build on a cordial telephone conversation the pair had in February.

“We do look forward to this future opportunity for the two leaders to meet,” Tillerson said at the beginning of a meeting with State Councilor Yang Jiechi, who outranks Wang as China’s top diplomat.  

 “The better they know one another, the stronger will be our bilateral relations, as well, because they can provide direction and guidance to both of our governments on how we can work more closely together to strengthen this very important relationship not just for our two countries but for many countries in the region and around the world,” Tillerson said.