Here’s a contrarian thought: President Trump had the right instinct to insist that China help resolve the nightmare problem of North Korea. A peaceful solution is impossible without help from the other great power in East Asia.

As Trump nears the threshold of a military crisis with North Korea, he needs to sustain this early intuition — and not be driven into actions that may look tough but would leave every player worse off. The template hasn’t really changed from the Korean War in 1950: North Korea’s aggressive actions bring an American response and then a general war that devastates the Korean Peninsula. The conflict ends in stalemate and at huge cost.

Trump in his first months saw the need for a negotiated halt in North Korea’s program. But he has been pushed toward military options by Kim Jong Un’s reckless continuation of his missile testing — despite China’s efforts to restrain the impulsive young leader. War fever is growing, as in Sen. Lindsey O. Graham’s (R-S.C.) comment Tuesday that conflict is “inevitable” unless Pyongyang stops testing weapons.

What is wise policy? Even as Trump ratchets up the pressure, he should quietly urge China to take the lead in a diplomatic solution. He should continue to make clear to Beijing that its economic and security interests would be severely harmed if the United States is forced to address the North Korea problem on its own, militarily.

Here’s a suggestion for Beijing: China should invite the other key players — the United States, Japan, South Korea, perhaps Russia — to gather in New York during the U.N. General Assembly meeting for talks about how to handle the North Korea problem. The model would be the “P5+1” group that sponsored the Iran nuclear talks. China was an observer back then; this time it would be the convener. Xi Jinping’s global status would be enhanced as he heads toward this fall’s big party congress that will shape his future as president.

North Korean Supreme Leader Kim Jong Un supervising the test-fire of a strategic ballistic missile. (North Korean Central News Agency via European Pressphoto Agency)

Three months ago, Trump was ready for face-to-face diplomacy with Kim, under Chinese sponsorship. He seemed to be packing his bags back on May 1, when he said: “If it would be appropriate for me to meet with him, I would absolutely, I would be honored to do it.” Ingratiating language aside, that was the right instinct. But now, Trump feels burned that the Chinese couldn’t stop Pyongyang’s missile tests, and the White House wants Xi to take the lead.

There was a tone of personal betrayal in Trump’s tweets last weekend: “I am very disappointed in China . . . they do NOTHING for us with North Korea, just talk.”

Because of Trump’s pique toward Beijing, trade is back on the table. The United States is readying harsh trade sanctions against Chinese steel producers and perhaps against several big Internet companies, too. Sources tell me that a milder trade deal worked out by Commerce Secretary Wilbur Ross last month was scuttled by the White House, humiliating the Chinese, and Ross too, but sending the message that Trump is serious in demanding China’s help on North Korea as the price of trade flexibility.

The U.S. Pacific Command is readying military options. But Defense Secretary Jim Mattis knows better than anyone that a military conflict would be a catastrophe. A preemptive strike by the United States would risk the deaths of hundreds of thousands of Koreans and Japanese (and U.S. residents of Seoul), albeit with little risk to the American homeland. That may appeal to some members of Congress, but it would outrage the rest of the world. It would also spin the problem of nuclear proliferation into a lawless zone of unilateral action, harming U.S. interests.

China knows that the road ahead is potentially ruinous. China’s U.N. ambassador, Liu Jieyi, said last month: “Currently tensions are high and we certainly would like to see a de-escalation. . . . If tension only goes up . . . then sooner or later it will get out of control and the consequences would be disastrous.” China’s state-run press also keeps hammering Pyongyang.

Russia, too, seems willing to be helpful on North Korea, as it was on Iran — because its interests are harmed by an erratic nuclear-weapons state.

Trump has the opportunity for a foreign policy reset in the shadow of the North Korea crisis. Russian President Vladimir Putin has overreached and been rebuffed by congressional sanctions. Kim has overreached with his relentless missile testing. Xi has overreached by offering more than he has delivered on curbing Pyongyang.

(Gillian Brockell,Kate Woodsome,Karen Attiah,Daniel Mich/The Washington Post)

The world is beginning to worry that Trump could go to war. Maybe that’s the moment when China helps to organize one of those “win-win” solutions that Xi is always talking about.

Read more from David Ignatius’s archive, follow him on Twitter or subscribe to his updates on Facebook.