Donald Trump has hit out at the "very one-sided and unfair" trade relationship between the US and China, but stopped short of criticising Chinese President Xi Jinping.
Speaking after the announcement of new business deals between US and Chinese companies, the US president said Beijing "must immediately address the unfair trade practices that drive" what he said is a "shockingly" large trade deficit, along with barriers to market access, forced technology transfers and intellectual property theft.
"But I don't blame China," he added. "After all, who can blame a country for being able to take advantage of another country for the benefit of its citizens?"
To applause, Mr Trump said: "I give China great credit."
His comments came during his second day in China and after lengthy meetings with Mr Xi.
The day included announcements that the US and China had signed agreements valued at more than $250bn for products including US-made jet engines, motor parts, liquefied natural gas (LNG) and beef.
Such contract signings are a fixture of foreign leader visits to Beijing and are intended to defuse foreign complaints about China's trade policies.
Many of the new contracts appeared to represent purchases that Chinese mobile phone makers, airlines and other customers would have made anyway, but were saved to be announced during Mr Trump's visit.
It was unclear if the pledges extend beyond a US-China trade agreement announced in May that featured LNG and beef exports to China.
Mr Trump had made narrowing the multibillion-dollar US trade deficit with China a priority for his administration. During the presidential campaign, he accused Beijing of "raping our country" on trade and pledged to minimise the trade imbalance.
China's trade surplus with the US in October widened by 12.2% from a year earlier, to $26.6b, according to Chinese customs data.
Mr Xi promised a more open business environment for foreign companies in China and said his country was committed to further opening its economy to foreign investment.
"China will not close its doors" and will open them "even wider", he said, pledging that foreign companies in China, including American ones, would find the market "more open, more transparent and more orderly".
Mr Xi said US-China relations were at a "new historic starting point", and declared: "The Pacific Ocean is big enough to accommodate both China and the United States."
Before arriving in China, Mr Trump had delivered a stern message to Beijing, using an address to the National Assembly in South Korea to call on China, North Korea's biggest trade partner, to do more to confront and isolate the antagonistic nation.
That included calling on China to fully implement UN Security Council resolutions aimed at depriving the North's government of revenue for its nuclear and ballistic missile programmes
"You cannot support, you cannot supply, you cannot accept," he said.
On Thursday he appeared far more conciliatory, thanking China for its efforts and saying he had been encouraged by his conversations.
"China can fix this problem easily. And quickly. And I am calling on China and your great president to hopefully work on it very hard," Mr Trump said. "If he works on it hard it will happen. There's no doubt about it."
It was an optimistic tone Mr Trump stuck throughout the day. Earlier, said he looked "forward to many years of success and friendship working together to solve not only our problems, but world problems, and problems of great danger and security".
"I believe we can solve almost all of them, and probably all of them."