The remarks came in the middle of Trump’s marathon 12-day trip through Asia focused on addressing Pyongyang’s nuclear threat while advancing America’s economic position in the Asia-Pacific.

"My feeling toward you is an incredibly warm one,” he said.

Trump elevated Beijing as an indispensable partner in bringing pressure on North Korea to relinquish its nuclear weapons program. While Trump reiterated his view that the US–China trade relationship has greatly disadvantaged the US, he emphasized that the fault is his US predecessors'.

Standing beside his counterpart in Beijing’s cavernous Great Hall of the People, Trump praised Xi for his hospitality and applauded him for consolidating power within the country's Communist Party. “I want to congratulate you on the recent and very successful 19th Party Congress,” he said.

BEIJING — Donald Trump left his China-bashing rhetoric at home on Thursday in an effort to enlist Beijing’s help in cracking down against North Korea’s nuclear program. Gone was the man who once excoriated Beijing for “ raping our country ” and who routinely vowed to slap a 45% tariff on Chinese imports while labeling the country a currency manipulator.

On Wednesday, Trump delivered a speech before South Korea’s parliament in Seoul, calling North Korean leader Kim Jong Un a “tyrant” whose “dark fantasy” is to rule over an “enslaved Korean people.”

A senior State Department official told reporters that while Trump’s trip to Seoul focused on calling out North Korea’s illegal actions, the president’s stop in Beijing was about underscoring China’s role in resolving the crisis.

"Without them really participating lock, stock, and barrel in this, it's not going to work,” the official said, speaking on condition of anonymity.

To be effective, Trump must use a more conciliatory tone while he’s in China, said Jia Qingguo, an international affairs scholar at Peking University in Beijing.

“He isn’t going to say the same things that he says for the domestic audience in the US,” Jia said. “When he visits this time, he wants to accomplish some realistic goals, He won't openly criticize because it won’t help him accomplish anything.”

Specifically, the US is pressing China to step up the enforcement of existing UN Security Council sanctions against North Korea at the local level, where US officials believe Beijing hasn’t exerted as much control.

“We don't trust local officials to read the fine print of these [UN] resolutions,” the State Department official said.

Both Chinese and US officials said that Beijing has taken some noticeable steps on North Korea following the Kim regime’s recent spate of attempts to upgrade its program — including a set of increasingly sophisticated ballistic missile launches and a nuclear test. China, for example, approved a new round of sanctions at the UN in September, said it would close off Pyongyang’s coal imports, and agreed to cut banking links and lessen exports of diesel fuel.

“We have noticed in some cases they've been forced to go beyond the UN Security Council resolutions,” the official said.

“They're going to businesses and saying, 'No kidding if you're trading with North Korea, you're going to be in deep kimchi,'” the official added, using slang popularized by Korean war veterans who apparently viewed the staple of salted and fermented vegetables unfavorably.

But China has stopped short from playing its more punishing card, cutting off crude oil, a step many believe it will never take for fear of destabilizing the regime. “All responsible nations must join together to stop arming and financing and even trading with the murderous North Korean regime,” Trump said. China remains North Korea’s biggest trading partner and most important diplomatic ally.

During the leg in Beijing, Commerce Secretary Wilbur Ross and his Chinese counterpart announced $9 billion in deals involving almost 20 companies, though details of the agreements remained elusive, and many were expected to come in the form of nonbinding memorandums of understanding rather than contracts.

They are expected to include agreements with energy and industrial businesses, such as DowDupont, General Electric, Bell Helicopter, and Honeywell International.

Ross’s eye-popping $9 billion figure comes as Forbes magazine said the former Wall Street investor “lied to us” about his net worth by billions of dollars in order to place on the elite “Forbes 400” list of wealthiest people in the US. On Tuesday, the magazine said it discovered the discrepancy when it reviewed the financial disclosure forms that Ross completed to become commerce secretary.

The lack of substantive announcements on trade cooperation or other “deliverables” stood out, and suggested a lack of close coordination between the world’s two largest economies in advance of the meeting. Trump said he had discussed the “chronic imbalance” in trade between the US and China — a campaign-era talking point — but he also said he raised problems from market access for US companies to technology transfer issues.

Some Chinese officials had complained that preparations for the trip were hamstrung by the White House’s failure to coordinate the competing interests of the departments of State, Commerce, and the Treasury and the Office of the US Trade Representative, a senior Asian diplomat told BuzzFeed News.

“There was a sense of desperation and confusion among diplomats in the Chinese Embassy in Washington,” the official said. “It was very chaotic.”