WASHINGTON — President Trump, frustrated by China’s inaction on North Korea, opened the door on Tuesday to concessions on his trade agenda with Beijing in exchange for greater Chinese support in pressuring Pyongyang. In doing so, he lashed together two sharply different issues in an already complex relationship.

“I explained to the President of China that a trade deal with the U.S. will be far better for them if they solve the North Korean problem!” Mr. Trump declared in a morning Twitter post. Minutes later, he warned: “North Korea is looking for trouble. If China decides to help, that would be great. If not, we will solve the problem without them! U.S.A.”

Mr. Trump’s threat rattled nerves in South Korea, where the government reassured the public that the United States would not launch an attack without first consulting Seoul. But the American president’s suggestion of a grand bargain with Beijing crystallized his quandary in dealing with North Korea.

Only China, with its vast economic leverage over its reclusive neighbor, can realistically force a change in the behavior of North Korea’s dictator, Kim Jong-un. Yet despite its own rising frustration with Mr. Kim, the Chinese government has so far been unwilling to tighten the vise on him.