Trump's visit to America's main strategic and economic rival, the first by a US president since his last trip in 2017, had aimed for tangible results to beef up his dented approval ratings before crucial midterm elections.
The summit was filled with pageantry, from grand receptions with goose-stepping soldiers to lavish banquets and private tours of a secret garden, while Trump repeatedly heaped praise on his host, commenting on his warmth and stature.
"It's been an incredible visit. I think a lot of good has come of it," Trump told Xi at their final meeting at the Zhongnanhai complex, which houses the offices of Chinese leaders.
But just before Friday's meeting, China's foreign ministry issued a blunt statement outlining its frustration with the United States and Israel's war with Iran.
"This conflict, which should never have happened, has no reason to continue," the ministry said, adding that China was supporting efforts to reach a peace deal in a war that had severely affected energy supplies and the global economy.
At Zhongnanhai, Trump said the leaders had discussed Iran and felt "very similar", though Xi did not comment.
Trump had been expected to urge China to use its leverage with Iran to make a deal.
But analysts doubt Xi will be willing to push Tehran hard or end support for its military, given Iran's value to Beijing as a strategic counterweight to the US.
A US summary of Thursday's talks highlighted what the White House called the leaders' shared desire to reopen energy choke point the Strait of Hormuz, and Xi's apparent interest in American oil purchases to pare its dependence on the Middle East.
US officials said they had also agreed on deals to sell farm goods and made progress on setting up mechanisms to manage future trade.
There were scant details of the deals, however, and no signs of a breakthrough on selling Nvidia's advanced H200 AI chips to China, despite CEO Jensen Huang's last-minute addition to the trip.
Trump told Fox News that China had agreed to order 200 Boeing jets, but that was far short of the roughly 500 expected by markets.
"For the market, the summit can be strategically reassuring while underwhelming in substance," Economist Intelligence Unit analyst Chim Lee said.
Chinese stocks slid on Friday as the summit produced few deals to excite investors.
The meeting's main achievement might be maintaining a fragile trade truce struck when the leaders last met in October and Trump suspended triple-digit tariffs on Chinese goods while Xi backed away from choking off supplies of vital rare earths.
The US had not yet been decided whether to extend the truce beyond its expiry later in 2026, Trade Representative Jamieson Greer said.
Xi's remarks to Trump that mishandling Taiwan, the democratically governed island Beijing claims, could lead to conflict, delivered a sharp, if not unprecedented, warning during a summit that otherwise appeared friendly and relaxed.
Taiwan has long been a flashpoint in ties, with Beijing refusing to rule out use of military force to gain control of the island and the US bound by law to provide it the means of self-defence.
"US policy on the issue of Taiwan is unchanged as of today," Secretary of State Marco Rubio, who is also travelling with Trump, told NBC News, adding the Chinese "always raise it ... we always make clear our position and we move on".
While they may not have clinched many deals, both sides celebrated a steadier footing in a relationship Xi called the most important in the world.
"We must make it work and never mess it up," he said at Thursday's state banquet.