U.S. President Donald Trump, by seeking to clinch a deal directly with Pyongyang, is attempting to effectively cut out the traditional middleman, China. Beijing's growing anxieties over the engagement between Washington and Pyongyang have prompted it to host North Korean strongman Kim Jong Un for the third time in less than three months.

In fact, the White House has already eroded China's role as an essential conduit in U.S. diplomacy with Pyongyang by establishing direct connections, including a virtual hotline, to Kim, while Chinese President Xi Jinping has no hotline with him.

Kim has also fueled Beijing's geopolitical troubles, displaying strategic defiance as he attempts to cut North Korea's dependence on China, its longtime benefactor. In his search for a grand bargain to end North Korea's international isolation, Kim effectively sidelined China by deciding to hold separate summits with his nation's bitterest enemies, South Korea and the U.S.

Instead of both Koreas leaning toward China, as Xi's strategy seeks, recent developments are consigning Beijing to a peripheral role in the region just when a trade war with the U.S. looms large. China has silently waged a trade war for years, facing no international reprisals. The situation will fundamentally change if the bulk of Trump's tariffs of 25% on $50 billion of imports from China take effect from July 6.

Kim's three visits to China in quick succession cannot obscure the serious strains in Beijing-Pyongyang relations, which Mao Zedong famously claimed were as close as lips are to teeth. Distrust of China, the historical rival of Koreans, runs deep in North Korea, which has no monuments honoring the 400,000 Chinese soldiers who died fighting on its behalf during the 1950-1953 Korean War.

Bilateral ties began deteriorating after Kim came to power in late 2011. China's state media accused him of pursuing the "de-Sinification" of the hermit kingdom. Kim broke with the tradition set by his father and grandfather, who ruled before him, of paying obeisance in Beijing. To counterbalance China's influence, Kim sent out feelers to U.S. President Barack Obama to improve relations, only to be rebuffed.

Yet Kim's defiance of China continued. His nuclear and missile tests were often timed to snub Beijing. The tests set in motion developments adverse to Chinese interests -- from initiating Japan's efforts to strengthen its military to prompting the U.S. to deploy the Terminal High Altitude Area Defense, or THAAD, anti-missile system in South Korea. THAAD's deployment led to China's heavy-handed and counterproductive economic sanctioning of South Korea.

Xi sought to ease the increasingly fraught relationship with Pyongyang only after Trump began laying the groundwork for a summit with Kim by using the U.S. Central Intelligence Agency to communicate with its North Korean counterpart, the Reconnaissance General Bureau. Despite the past North Korean snubs, Xi sent a senior envoy to Pyongyang to invite Kim to China, his first foreign trip since assuming power.

Kim's China visits since late March have been primarily aimed at strengthening his own bargaining position with the U.S. By playing one power against the other, he has sought to bolster his leverage. But his action in inviting observers from the U.S. and South Korea, but not China, to the dismantlement of North Korea's nuclear test site indicated that he is unwilling to forgive Beijing for its linchpin role in imposing United Nations sanctions against his nation.

Consequently, China, which values North Korea as a strategic buffer against the U.S. military presence in South Korea, has become increasingly suspicious of Kim's overtures to Washington and the Trump administration's direct dealings with Pyongyang. U.S. Secretary of State Mike Pompeo's visit to Beijing after the Trump-Xi summit did little to allay Chinese apprehensions.

Beijing fears that, just as it formally turned against the Soviet Union after it developed high-level contacts with the U.S. in the early 1970s, its estranged ally, North Korea, could similarly switch sides now. Kim, however, seems more interested in achieving a limited goal -- rebalancing his foreign policy by mending fences with the U.S. to reduce North Korea's reliance on China, whose neo-imperialist policies are arousing growing concerns in Asia and beyond.

Make no mistake: The path to North Korea's denuclearization promises to be long and difficult, given its extensive nuclear and missile infrastructure and Kim's firm belief that the nuclear arsenal serves as insurance against his country becoming China's colony. Not only does such an arsenal hold greater security implications for China than for the U.S., but also Trump's diplomacy is making it more difficult for Beijing to keep North Korea in its orbit. Washington's direct diplomacy with North Korea began in dramatic fashion, with Pompeo, when he was CIA chief, holding unpublicized talks with Kim in Pyongyang.

Yet some analysts have speciously claimed that China, without being at the table, was the clear winner from Trump's summit with Kim. Critics have accused Trump of making "big concessions" in exchange for securing indefinable commitments from Kim. The only concession Trump made -- suspending U.S. war games with South Korea as a gesture of good faith -- is easily reversible if negotiations do not yield progress.

To be sure, Beijing last September proposed the suspension of the U.S. military exercises in exchange for a North Korean moratorium on nuclear and missile testing. It was Kim, however, who undermined China's "freeze for freeze" proposal by unilaterally declaring a test moratorium in April without any reciprocal U.S. concession.

Under Obama, the U.S. helped end Myanmar's international isolation, with the U.S. president paying a historic visit to that county in 2012. The shift in U.S. policy allowed Myanmar to cut its dependence on China and open its economy to Western investors. Now Trump is encouraging another isolated, China-dependent state, North Korea, to end its international pariah status.

North Korea -- with its vast store of iron ore, magnesite, copper and other minerals -- is resource-rich like Myanmar, whose natural reserves range from oil and gas to jade and timber. Resource-hungry China has been the dominant importer of natural resources from both of these countries.

North Korea, however, is different from Myanmar in two key aspects. It is armed with potent nuclear and missile capabilities, while it is also a homogenous and regimented society, in contrast to ethnically diverse and troubled Myanmar.

Trump is right that at this stage fundamentally changing the U.S.-North Korea relationship matters more than denuclearization. If the West encourages Kim's efforts to modernize the North Korean economy, just as it aided China's economic rise since the late 1970s, it will help to moderate Pyongyang's behavior. Economic engagement can achieve a lot more than economic sanctions, which counterproductively accelerated North Korea's nuclear and missile advances.

U.S. policy under Trump's predecessors, instead of helping Pyongyang to escape from China's clutches, attempted to push it further into China's corner. It also helped Beijing to play the North Korea card against the U.S. and its regional allies, Japan and South Korea.

But Beijing's efforts to string the U.S. along on North Korea came to naught when Washington established direct contact with Pyongyang. Beijing even tried to use its North Korea leverage in the trade dispute with Washington, which explains why Trump waited until after his summit with Kim to announce new planned tariffs against China.

With Washington's sanctions-only approach encouraging Pyongyang to expand its nuclear and missile programs, a shift in its North Korea policy became imperative even before Trump took office. Trump's direct diplomacy seeks to address that imperative by seizing on Pyongyang's desire to unlock frozen ties with the U.S. and by exploiting the China-North Korea rift.

At the core of Trump's North Korea gambit is the containment of China, a fact many analysts have missed. By seeking to co-opt North Korea, including encouraging closer links with Seoul, Washington aims to foster a major new regional alignment that diminishes China's relevance.

If Beijing cannot keep North Korea as a client state, China's lonely rise will become more conspicuous. Its only other strategic ally is Pakistan. The more power China has accumulated, the greater has been its problems in gaining reliable security partners, underscoring that regional leadership demands more than brute might.

Clearing the path to North Korean disarmament will not be easy. Yet Trump's direct diplomacy promises to positively change northeast Asian geopolitics by crimping China's leverage and role, even as U.S. troops remain in South Korea. If Washington stays on its current course, China will be the clear loser.

Brahma Chellaney is a geostrategist and the author of nine books, including the award-winning "Water: Asia's New Battleground."

Brahma Chellaney is a geostrategist and the author of nine books, including the award-winning "Water: Asia's New Battleground."