BEIJING — When he assumed power in 2013, President Xi Jinping of China tried to court one of America’s main Asian allies, South Korea. It worked for a while. Then the relationship soured.
South Korea’s president at the time, Park Geun-hye, showed great respect for Mr. Xi, appearing shoulder to shoulder with him at a military parade in Tiananmen Square, the only American ally to do so. Then she turned on Mr. Xi when he declined to rein in North Korea as much as she had expected.
Mr. Moon, a proponent of engagement with North Korea, is a more natural friend for Mr. Xi than the conservative Ms. Park, who is in jail facing corruption charges.
As North Korea steps up the frequency of its missile tests and prepares for a sixth nuclear test, it has become more important for China to make common cause with South Korea if it wants to find a diplomatic solution to the standoff with the North, as Beijing insists that it does.
China’s relationship with North Korea, its ostensible ally, is at a ragged low, and its ties with the South are in poor shape. All at once, Beijing is at odds with both Koreas.
But while Mr. Xi welcomes Mr. Moon as a preferable alternative to Ms. Park, he is concerned about one point of contention.
Mr. Xi has made it clear that an American missile defense system that was authorized by Ms. Park and quickly set up by the United States in South Korea just before Mr. Moon took office is a major obstacle to good relations.
Beijing complains that the system, the Terminal High Altitude Area Defense battery, known as Thaad, which the Americans designed to protect South Korea against the North, undermines China’s missile force and its ability to deter a nuclear attack.
China views Thaad as just one element in an effort to contain its military by building a strategic architecture that would eventually connect South Korea, Japan and the United States.
“Stopping the deployment of Thaad is the bottom line of China,” said Global Times, a state-run newspaper that often reflects the thinking of the Communist Party leadership, soon after Mr. Moon’s election. “Seoul needs to make a choice between deploying Thaad and resuming Sino-South Korean relations. It should not hope to have it both ways.”
How is Mr. Moon, a lawyer, going to finesse the demands of China that Thaad disappear, and the insistence of the United States that it remain?
It will be difficult, Chinese experts say. Mr. Xi will try to persuade Mr. Moon to make some unpalatable compromises, they say, ones that would not sit well with the American military.
Already, Mr. Moon appears to be at loggerheads with the Pentagon. On Tuesday, he ordered a wide-ranging investigation into how four new Thaad launchers had arrived in South Korea without his knowledge. The launchers are intended to supplement the two Thaad installations already in place.
But even rejecting the new equipment may not satisfy China.
“South Korea could make a promise to only allow one set of Thaad on its territory,” said Cheng Xiaohe, an associate professor of international relations at Renmin University in Beijing. Mr. Cheng was referring to assessments that South Korea does not have sufficient Thaad batteries yet to protect the entire country, and will need more.
“But that’s not enough,” Mr. Cheng added. “China could ask South Korea not to join a trilateral alliance with Japan and the United States.” Since the 1990s, China has been concerned that the United States wants to form a NATO-like alliance on its doorstep.
China could also demand that Mr. Moon’s government allow China to verify that Thaad’s radar system can detect incoming missiles only within 800 kilometers (about 500 miles) and not 2,000 kilometers (about 1,200 miles), Mr. Cheng said.
But intrusive inspection of Thaad on South Korean territory by China for verification purposes would be rejected by the Pentagon, he acknowledged.
A Chinese rocket scientist, Wu Riqiang, said in an interview that the Thaad system allowed the United States to monitor Chinese intercontinental ballistic missiles from the moment they were fired from bases in central China. The American military would then have the ability to differentiate between real warheads and decoys carried on the missiles, thus weakening China’s deterrent.
“I don’t think China can persuade South Korea to give up Thaad,” said Mr. Wu, an arms control expert who has worked at China’s Defense Ministry. In response to the missile defense system next door, he added, “China will build more nuclear weapons but won’t do so publicly.”
During the South Korean election campaign, Mr. Moon said he opposed the rushed deployment of Thaad, noting that it had not been put to a vote.
Mr. Moon has asked South Korean lawmakers to assess the initial decision on deployment, a move intended to buy some time.
“There is a search for a face-saving trigger,” said John Delury, associate professor of Chinese studies at Yonsei University in Seoul, South Korea. “During the review, the Thaad equipment would stay there but would be turned off.”
Despite the difficulties over the missile defense system, China seems to sense that it has a better chance of driving a wedge between South Korea and the United States with Mr. Moon than with his predecessor, especially with President Trump in the White House.
Since the Korean War, when the United States fought to prevent the North from overrunning the South, American presidents have kept their commitments to the alliance.
Mr. Xi can capitalize on Mr. Trump’s distaste for alliances. In April, Mr. Trump called a five-year-old American trade accord with South Korea “a horrible deal” that had left America “destroyed.”
During his campaign, Mr. Trump accused South Korea of not paying its share to maintain 28,500 American troops in the country, although once he took office he called the alliance “ironclad.”
Mr. Trump’s grumbling probably strikes South Koreans as more true to form. The president sent shudders through the South Korean election campaign in April when he said he wanted Seoul to pay the estimated $1 billion cost of Thaad.
The opening moves between Mr. Xi and Mr. Moon have taken place indirectly and under subdued circumstances. They have yet to meet.
A South Korean envoy, Lee Hae-chan, arrived in Beijing shortly after Mr. Moon assumed office.
Mr. Xi took matters into his own hands, showing who was in charge. At a session between the Chinese and South Korean delegations in Beijing, Mr. Xi sat alone at a head table with the other officials seated below him, a choreography meant to show China’s dominance that was widely noted.
After the deployment of Thaad, Beijing, which is Seoul’s largest trading partner, encouraged Chinese consumers to boycott South Korean cars, phones, bands, television shows and even kimchi. Using the pretext of safety violations, the Chinese authorities closed half of the 112 stores operated in China by the South Korean conglomerate Lotte, and the company’s website was hacked. Chinese tourism to South Korea slowed to a trickle.
There has been only grudging relief.
The day after Mr. Lee’s visit, the Lotte website was restored. But the stores remain shuttered, possibly pending a positive move by Mr. Moon on the American missile defense system in South Korea.