North Korean leader Kim Jong Un made a surprise visit to China on Monday night, the strongest indication yet that he intends to play hardball when he meets President Donald Trump for a second planned summit to discuss North Korea’s nuclear program.

The two leaders are expected to meet sometime in the next few months, likely in Thailand, Vietnam, or even Hawaii. But the nuclear negotiations remain at an impasse since they first met in Singapore last June — with the US demanding that North Korea dismantle its nuclear program first before the US will lift any sanctions on the country, and North Korea demanding the sanctions be lifted before it begins seriously downgrading its nuclear capabilities.

With such little diplomatic progress, the China visit shows that Kim wants to strengthen his hand before his next meeting with Trump. “Kim is out there creating leverage for those negotiations by meeting with the chief rival of his enemy,” Eric Brewer, who worked on North Korea in Trump’s National Security Council, told me.

If Kim can get China to give him the economic relief he seeks, then the North Korean premier will have less interest in cutting a deal with the US. That’s bad news for Trump’s hopes of striking a massive bargain — and bad news for global security.

Kim needs China to put pressure on Trump

Since last year, Kim has repeatedly said that his main focus is to improve his country’s economy. That goal is much harder to achieve because of sanctions the United Nations imposed in 2017 after North Korea’s many provocative missile tests.

Kim has had no success in getting the US to push the UN to lift those financial penalties, so he may be trying his next best option: China.

Jung Pak, a Korea expert at the Brookings Institution think tank in Washington, says Kim’s goal is to convince Xi to have China move to end the sanctions. That’d be huge since China accounts for about 90 percent of North Korea’s trade. Personally making the trip to Beijing to meet with the Chinese president — and possibly giving Xi a preview of the summit with Trump — is certainly one way to garner China’s help.

Having Beijing in Pyongyang’s corner isn’t the worst way for Kim to hedge his bets before meeting with the American president.

“Kim Jong Un is not feeling confident about his second summit with Donald Trump, so he is trying to court his Chinese counterpart,” Zhao Tong of the Carnegie-Tsinghua Center in Beijing told the Washington Post on Tuesday. “This sends a message to the US that, even if the US does not cooperate, even if they keep the economic sanctions, North Korea can still do well with China’s support.”

Kim, then, is essentially playing a double game. He needs China’s support for North Korea’s general well-being, but he also needs it in case he can’t strike any nukes-for-sanctions deal with Trump.

That’s still a tall order, since Xi and Kim don’t particularly like each other. Experts say Xi has offered advice to Kim about how he could improve his country — advice Kim routinely ignores. Meanwhile, Kim desperately wants North Korea to operate with little Chinese help, but he plays nice with Beijing to keep the money flowing.

That distance gave the US the opportunity to offer North Korea an economic lifeline. But if Beijing and Pyongyang get closer, that opportunity mostly ends.

“The mending of political ties between North Korea and China does undermine the international pressure campaign that the United States worked to build,” said Brewer, who is now at the Center for a New American Security think tank in Washington.