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,” Global Times, a state-run newspaper that often reflects the thinking of the Communist Party leadership, said 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.