But he also urged Mr Xi to “work very hard” on persuading North Korea to denuclearise.
On China’s trade surplus, Mr Trump surprised many when he said he did “not blame China” for “taking advantage”.
The US president was speaking in Beijing while on a state visit.
He is in the Chinese capital as part of his five-nation tour of Asia. The two leaders held talks earlier on Thursday after a grand welcome for Mr Trump.
They also announced the signing of $250bn (£190bn) worth of business deals during Mr Trump’s visit, although it is unclear how much of that figure is past deals being re-announced or simply the potential for future deals.
Mr Trump, together with Mr Xi, gave speeches twice on Thursday. These are the most striking highlights:
Trump tried to cajole Xi on Pyongyang
Discussion on how to deal with North Korea’s threats to the region has dominated Mr Trump’s agenda, and China is Pyongyang’s main economic supporter.
Offering warm encouragement on Thursday, Mr Trump said China “can fix this problem easily and quickly”, in reference to North Korea’s nuclear programme.
He added: “I am calling on [Mr Xi] to work very hard. I know one thing about your president. If he works on it hard, it’ll get done.”
He then thanked Mr Xi several times for efforts such as restricting trade with Pyongyang.
Mr Xi, for his part, said both sides would “continue to work towards” fully implementing UN sanctions and “enduring peace” on the Korean peninsula.
Mr Trump has previously criticised China for not doing enough to pressure North Korea, and tweeted in July that Beijing was doing “NOTHING for us with North Korea, just talk”.
Just before his arrival in Beijing he urged China to sever ties with the North. Beijing has consistently said it is doing all it can.
He swerved away from blaming China for the trade deficit
“I don’t blame China – after all, who can blame a country for taking advantage of another country for the benefit of its citizens… I give China great credit,” said Mr Trump while addressing a room of business leaders.
Instead, the US leader said previous US administrations were responsible for what he called “a very unfair and one-sided” trade relationship with China.
Media caption: Why the US president keeps mentioning Indo-Pacific
Before taking office Mr Trump did not hold back from hostile anti-China rhetoric and he has complained about what he recently called a “horrible” and “embarrassing” trade deficit with China.
He has previously accused it of stealing American jobs and threatened to label it a currency manipulator, though he has since rowed back on such rhetoric.
Mr Xi on Thursday promised “healthy” and “balanced” economic and trade relations, adding that “co-operation is the only correct choice and only a win-win [situation] can lead to a better future.”
The two leaders also said they would to work together to tackle terrorism and drug trafficking, while Xinhua state news agency reported that Mr Trump had said the US government upholds the “one China” policy in his talks with Mr Xi.
He has poured praise on Xi
Since arriving in Beijing, Mr Trump has been fulsome in his praise for the Chinese leader, saying at one point: “You are a very special man.”
He has also enthusiastically thanked Mr Xi for his hospitality in several tweets.
President Xi, thank you for such an incredible welcome ceremony. It was a truly memorable and impressive display! https://instagram.com/p/BbQ3bcJADfy/
— Donald J. Trump (@realDonaldTrump) 2:08 AM – Nov 9, 2017
Looking forward to a full day of meetings with President Xi and our delegations tomorrow. THANK YOU for the beautiful welcome China! @FLOTUS Melania and I will never forget it!
— Donald J. Trump (@realDonaldTrump) 10:40 AM – Nov 8, 2017
On behalf of @FLOTUS Melania and I, THANK YOU for an unforgettable afternoon and evening at the Forbidden City in Beijing, President Xi and Madame Peng Liyuan. We are looking forward to rejoining you tomorrow morning! https://twitter.com/AFP/status/928179585832779776 …— Donald J. Trump (@realDonaldTrump) 9:27 AM – Nov 8, 2017
Mr Trump flew into Beijing on Wednesday and was greeted with great pomp and ceremony, in what was billed as a “state visit-plus”. He will attend a state dinner later on Thursday.
He has tweeted several times since arriving in China – where Twitter is banned. But a White House official told reporters that he would “tweet whatever he wants”.
As part of his Asia trip Mr Trump has already visited South Korea and Japan, and will go on to Vietnam and the Philippines later in the week.