BEIJING — The two men stood together on the reviewing stand in the North Korean capital: a top official in China’s Communist leadership wearing a tailored business suit and a young dictator in a blue jacket buttoned to his chin.
Liu Yunshan, the visiting Chinese dignitary, and Kim Jong-un, the North Korean leader, tried to put on a show of friendship, chatting amiably as the cameras rolled, but just as often they stood silent, staring ahead as a military parade passed before them.
Nearly two years have elapsed since that encounter, the last high-level visit between China and North Korea. The stretch of time is a sign of the distance between two nations with a torturous history: one a rising power seeking regional dominance, the other an unpredictable neighbor with its own ambitions.
China has made little secret of its long-term goal to replace the United States as the major power in Asia and assume what it considers its rightful position at the center of the fastest-growing, most dynamic region in the world.
Other major hurdles litter China’s path. The United States, despite signs of retreat in Asia under the Trump administration, remains the dominant military power. And India and Japan, China’s traditional rivals in the region, have made clear that they intend to resist its gravitational pull.
Yet North Korea — an outcast of the international order that Beijing hopes to lead, but also a nuclear state in part because of China’s own policies — presents a particularly nettlesome challenge.
China’s path to dominance requires an American withdrawal and a message to American allies that they cannot count on the United States for protection. But North Korea threatens to draw the United States more deeply into the region and complicate China’s effort to diminish its influence and persuade countries to live without its nuclear umbrella.
At the same time, the strategic location of the North — and its advancing nuclear capabilities — make it dangerous for China to restrain it.
“North Korea may not be the biggest problem to China, but it does add a unique and very serious dimension to China’s task of supplanting America in East Asia,” said Hugh White, a former strategist for the Australian Defense Department. “That’s because it is the only East Asian power with nuclear weapons.”
Even if the United States steps back from the region, Mr. White added, “North Korea’s capability means China can never be able to dominate the region as much as its leaders today probably hope.”
The Trump administration has bet on China to stop North Korea’s nuclear program, shunning talks with Mr. Kim and gambling that Beijing can be persuaded to use its economic leverage over the North to rein it in.
But in doing so, the White House may be misreading the complexity of China’s relationship with North Korea, one that successive generations of Chinese leaders have struggled to manage.
A New Cold War
There is growing resentment against Mr. Kim inside China, both in the general public and the policy establishment. China keeps North Korea running with oil shipments and accounts for almost all its foreign trade. But to many Chinese, the young leader seems ungrateful.
A three-day academic seminar in Shanghai last month brought together some critics, who question North Korea’s value to Beijing as a strategic buffer against South Korea and Japan — and warn that the North could prompt them to develop nuclear weapons of their own.
“The cost is to continue to alienate Japan, enrage the United States and irritate South Korea,” said Zhu Feng, a professor of international relations at Nanjing University. “If Japan and South Korea feel forced to go for radical options like nuclear weapons, it will badly affect regional diplomacy.”
The spread of nuclear weapons, he added, would thrust China into “a new Cold War” in Asia, perhaps with a beefed-up American military presence. That would frustrate Beijing’s ambitions for regional supremacy while also leaving it vulnerable to being labeled an enabler of nuclear proliferation, tarnishing its international reputation.
“A balance of mutually assured destruction in Northeast Asia will not be a satisfactory situation for anyone,” said Bilahari Kausikan, a former foreign secretary for Singapore. “But it will not necessarily be unstable, and it may be of some small consolation to Washington, Tokyo and Seoul that the implications for Beijing are somewhat worse.”
President Xi Jinping is said to be aware of such risks and to have privately expressed disdain for Mr. Kim.
But like his predecessors, he has resisted punishing sanctions that might cause North Korea’s collapse and lead to a destabilizing war on its border, a refugee crisis in China’s economically vulnerable northeast, or a unified Korean Peninsula controlled by American forces.
All these possibilities could pose as much a problem for China’s plans for ascendancy in Asia as an arms race in the region. And if North Korea somehow survived, it would remain on China’s border, angry and aggrieved.
From Mr. Xi’s perspective, a hostile neighbor armed with nuclear weapons may be the worst outcome.
The Pakistan Connection
China has more nuclear-armed neighbors than any country in the world: Russia, India, Pakistan and now North Korea. But that situation is partly one of its own making.
The origins of North Korea’s nuclear program can be traced to a deal in 1976 between an ailing Mao Zedong and Zulfikar Ali Bhutto, then the prime minister of Pakistan.
India had tested its first nuclear bomb two years earlier, and Mr. Bhutto wanted to keep up. China viewed India as a potential threat; the two had fought a brief border war. So it agreed to help.
The particulars were ironed out by Pakistani visitors to Mao’s funeral, according to the account of A. Q. Khan, the nuclear physicist who founded the uranium enrichment program of Pakistan’s bomb project.
In 1982, China shipped weapons-grade uranium to Pakistan. And in 1990, it opened its Lop Nur test site to Pakistan and secretly let the country test its first nuclear bomb there, according to “The Nuclear Express,” a book by two veterans of the American nuclear program.
The United States, upset by China’s behavior, including its sale of missile technology across the developing world, pressed it behind the scenes to stop and persuaded it to sign the Nuclear Nonproliferation Treaty in 1992.
But Beijing’s recognition of the risks of proliferation came slowly, and the genie was already out of the bottle. In 1998, when India conductedfive nuclear tests, Pakistan responded with a public test of its own less than three weeks later.
At about the same time, Pakistan was sharing nuclear enrichment technology with North Korea — including centrifuges, parts, designs and fuel essential for its nuclear bombs — in exchange for Korean missile technology and design help. Pakistan later accused Mr. Khan of acting on his own, but he maintains that he had the government’s blessing.
By 2002, the trade was so brazen that Pakistan sent an American-made C-130 cargo plane to North Korea to collect a shipment of ballistic missile parts, a flight that was detected by United States satellites.
Some analysts argue that Beijing was complicit in the deal, either encouraging Pakistan to share nuclear technology with North Korea or looking the other way as it happened. China allowed the transfers to occur through Pakistan to maintain plausible deniability, they say.
“My guess is that most Western analysts, perhaps a bit cynically, would assume that Chinese officials were fully aware of the nuclear trade, given the strong ties between the Pakistani and Chinese nuclear establishments,” said Toby Dalton, a nuclear nonproliferation expert at the Carnegie Endowment for International Peace and a former official at the Energy Department.
“I think it is fair to assess that North Korea wouldn’t be where it is today without the earlier trade with Pakistan,” he added. “But given Pyongyang’s determination to have nuclear weapons, it wouldn’t be that far behind.”
Others say that while there is no doubt that China helped Pakistan acquire the bomb, Beijing would not have wanted that know-how passed on to North Korea.
“For China, assisting Pakistan’s nuclear program has had clear strategic benefits,” said Daniel S. Markey, an expert on Pakistan at Johns Hopkins University. “But the onward proliferation to North Korea was almost certainly an unintended consequence not foreseen by Beijing.”
While China wanted Pakistan to counterbalance India, it is less clear how it would have benefited from the North’s obtaining nuclear technology. Beijing’s ties with South Korea were improving at the time, but its relationship with the North had hit a rocky patch — again.
Blood and Betrayal
Mao is often quoted in the West as saying that North Korea and China are “as close as lips and teeth.” But his actual words, an ancient Chinese idiom, are better translated, “If the lips are gone, the teeth will be cold.” He was warning that China would be in danger without North Korea.
In 1950, Mao sent more than one million Chinese soldiers, including his own son, into the Korean War to help the North fight the United States. By the time the armistice was signed three years later, more than 400,000 Chinese troops had been killed and wounded, a sacrifice in blood that one might have expected to forge a lasting loyalty between the two countries.
But there has always been an edge to the relationship, bred at the start by two Communist rivalries — between Mao and North Korea’s founder, Kim Il-sung, and between Mao and Stalin, who both saw themselves as overlords of the new state created after World War II.
Then Kim showed who was in charge, purging a faction of senior leaders with Soviet connections in 1955 and moving the next year against more than a dozen members of an elite North Korean military group with ties to Mao. Several were arrested while a handful escaped to China.
The Soviets urged Mao to join them in retaliating against Kim. Chinese troops had not fully withdrawn from the North yet. But Mao demurred, according to a recent article by Sergey Radchenko, a professor of international studies at Cardiff University, citing newly declassified documents from Russian archives.
For the most part, Mao tolerated North Korea’s displays of disloyalty because he was afraid of losing it to the Soviet Union, which was the North’s main economic benefactor and provided it with aid that Mao could not match.
After the collapse of the Soviet Union, though, China enjoyed more room to maneuver. In 1992, seeking trade, it established diplomatic relations with South Korea, infuriating the North, which was suddenly poorer and more isolated than ever.
From then on, according to Shen Zhihua, a historian of Chinese-Korean relations, “The treaty of alliance between China and North Korea became a piece of scrap paper.”
China now imports more goods from South Korea than it does from any other country, while the South counts China as its largest market for both exports and imports. One of President Xi’s first foreign policy initiatives sought to take advantage of those ties and weaken the South Korean alliance with the United States.
But North Korea got in the way. After the North conducted its fourth nuclear test in early 2016, South Korea’s president at the time, Park Geun-hye, tried to call Mr. Xi to ask for his help in restraining Kim Jong-un.
Ms. Park’s aides were unable to arrange the call, according to local news reports. Chinese analysts said Mr. Xi was unwilling to accept Ms. Park’s demand for “the most severe” sanctions against the North.
By refusing to abandon Pyongyang, Mr. Xi lost ground in Seoul.
Ms. Park strengthened relations with Washington and agreed to deploy a missile defense system that Beijing opposed.
For more than a decade, the United States has asked China for talks to discuss what each nation would do if North Korea collapses — but China has resisted, worried that agreeing to do so would be a betrayal.
Among the most pressing questions: Where are the North’s nuclear weapons and who would secure them? How would the two countries’ military forces avoid clashing as they raced to do so? And what should the Korean Peninsula look like afterward?
The Pentagon has asked Beijing to discuss such “contingency plans” since the presidency of George W. Bush, but on each occasion, the Chinese response has been silence, according to a former United States defense official, who requested anonymity because he was not authorized to speak on the subject.
“The Chinese are concerned about how the North Koreans would react,” said Ralph A. Cossa, the president of the Pacific Forum CSIS in Honolulu. “I think it stops the conversation in the room.”
In a rare departure, Chinese military officials expressed an interest in the subject in 2006, the year the North conducted its first nuclear test, said an American official familiar with the conversations. But the Pentagon was suspicious that the Chinese were seeking to learn as much as possible about the United States’ plans without revealing their own thinking, the official said.
As tensions have climbed in recent weeks, questions about what China would do in a crisis remain unanswered. But there is a broad understanding that Beijing would be opposed to American forces crossing the 38th parallel that divides North and South Korea.
Global Times, a state-owned tabloid that reflects the opinion of some segments of the party elite, published an editorial last month warning North Korea that China would remain neutral if it attacked the United States.
But the editorial also said that China was prepared to stop any attempt by American and South Korean forces “to overthrow the North Korean regime and change the political pattern of the Korean Peninsula.”
“The common expectation,” said Yun Sun, a scholar at the Stimson Center in Washington, “is that China is prepared to intervene to preserve a functional North Korean government, as well as the survival of North Korea as a country.”
American research institutes regularly convene “tabletop exercises” about North Korea — meetings in which participants are divided into teams representing different nations and asked to discuss how they would respond in a simulated emergency situation.
One analyst who has led these drills said the mutual suspicions run deep: The two teams representing China and the United States often end up shooting at each other.
On occasion, Chinese scholars and retired military officers agree to participate in the sessions. But Phillip C. Saunders, the director of the Center for the Study of Chinese Military Affairs at the National Defense University, said they usually emphasized two well-worn points:
The North Korean government is stable, and China’s influence over North Korea is limited.