Updated

President Trump, at a lavish state dinner with the Chinese president in Beijing, called out his host country for “very one-sided and unfair” trade deals and urged China to do more to pressure neighboring North Korea – while also saying he can’t “blame” China for having taken advantage of the U.S. all these years.

"I don't blame China. Who can blame a country for being able to take advantage of another country for the benefit if its citizens? I give China great credit,” Trump joked Thursday.

But things turned serious when Trump said China "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.

Trump made the comments after announcing new business deals between the U.S. and Chinese companies, in-between meetings with Chinese President Xi Jinping on his overseas trip.

Trump, after visiting South Korea, also has tried to apply new diplomatic pressure on China to lean on North Korea to abandon its nuclear pursuits.

“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,” Trump said, calling on all countries to stop doing business with Pyongyang while praising Chinese efforts so far to restrict trade.

Trump’s remarks came during his second day in China and after lengthy meetings with President Xi Jinping.

The day included announcements that the U.S. and China had signed agreements valued at more than $250 billion for products that included U.S.-made jet engines, auto parts, liquefied natural gas and beef.

Trump had made narrowing the multibillion-dollar U.S. trade deficit with China a priority for his administration. During the presidential campaign, he accused China of "raping our country" on trade and pledged to minimize the countries' trade imbalance.

China's trade surplus with the United States in October widened by 12.2 percent from a year earlier, to $26.6 billion, according to Chinese customs data released Wednesday. The total surplus with the United States for the first 10 months of the year rose to $223 billion.

Xi promised to open more doors for foreign companies in China and described U.S.-China relations as standing at a “new historic starting point.”

"The Pacific Ocean is big enough to accommodate both China and the United States,” Xi said.

The United States and other trading partners have been pressing Beijing to give their companies more access to its state-dominated economy. But it remains unclear how far China will go to fulfill its pledges. Previous U.S. administrations have hailed market-opening promises only to be left disappointed.

The Associated Press contributed to this report.