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.
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.
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 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.
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.