Stock markets fell in early morning trading, with the S&P 500 down more than 1 percent but regained ground after Mr. Trump’s comments.

It remains unclear whether the two countries can salvage a trade agreement that is complicated by political dynamics on both sides of the Pacific. Mr. Trump, who has promised to be tough on China, is eager to avoid being seen as signing a weak deal that does not take advantage of the leverage the United States has created with its tariffs. But Mr. Xi is also facing pressure from hard-liners in China, who do not want to acquiesce to the United States, particularly Washington’s demands that China make changes to its laws.

On Friday, the trade dispute appeared to be lurching toward an all-out economic war. China has threatened to retaliate with its own “countermeasures,” which include ending purchases of American farm goods and establishing other nontariff barriers for companies trying to gain access to the Chinese market.

Mr. Trump continued to insist that his tough approach would benefit the United States economy, particularly farmers, who have faced retaliation from China as a result of the trade war. But the president suggested he would once again try to insulate farmers, many of whom support his presidency, from additional pain through another round of financial support. The administration previously created a $12 billion aid program to help compensate farmers for trade-related losses.

Chinese officials said the decision to come to the United States after Mr. Trump’s tariff threat was intended to show that they were serious about continuing discussions. But it is unclear whether China is willing to make the changes that the Trump administration is demanding, including codifying much of the emerging agreement into law. Mr. Trump’s advisers want to ensure China does not violate an agreement that is aimed at giving American companies greater access to China’s market and ensuring protections for their technology and trade secrets.

“I come here facing pressure,” Mr. Liu said on Thursday in an interview with China Central Television in Washington. “That expresses China’s greatest sincerity. And we want to resolve some of the differences we face honestly, confidently and rationally. I think there is hope.”