Despite disagreements over trade and North Korea, the two leaders and their wives were all smiles as they ambled through the former imperial palace, first built in the 15th century.
During Xi's stay, Trump filled him in about a USA airstrike on a Syrian military installation over "the most attractive piece of chocolate cake".
Xi prepared an extravagant "state visit-plus" for Trump, who has softened his strongly anti-China election-era rhetoric since their first meeting at his Mar-a-Lago resort in Florida in April.
Trump is also under mounting pressure from USA business groups to solve trade complaints with Beijing. But it also underscored the geopolitical realities Trump has had to confront as President - and the relief here that he has yet to enact numerous toughest measures he pledged at almost every campaign trail rally.
"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".
"If we get China, if we get Russian Federation. we think that things will happen and they could happen very quickly", Trump added.
The chairman of the American Chamber of Commerce in China, William Zarit, expressed hope ahead of Trump's arrival that the signing of business deals wouldn't draw attention away from "structural issues" including Chinese limits on foreign activity in finance, health care and other industries.
Donald Trump will receive an honor in Beijing not granted to any US President since the founding of the People's Republic of China: official dinner inside the Forbidden City. "We're having a great time".
At a joint press conference with South Korea's Moon Tuesday, Trump emphasized how important China was to the North Korea issue, saying Xi "has been very helpful". -China relations under Trump's administration, unlike other sectors such as steel and aluminum where the two countries have faced disputes.More news: Sia responds to creeper selling her nudes by giving it away
"It's just that Trump uses somewhat stronger words", he says.
While Trump said he sees "certain movement" on the issue, he declined to comment on holding direct talks with North Korea and said the USA is ready - "if need be" - to use the full range of its military capabilities.
"China had to realize that Trump needed to learn about China", he says, "and during this learning process, we had to stay cool and patient".
China is increasingly disenchanted with North Korea over its nuclear weapons development but remains wary of using its full economic leverage over its traditional ally.
But the presidency has a way of bringing uncomfortable realities crashing down on the most powerful person in the world, like the undeniably intertwined fates of the USA and Chinese economies. "Why not?" the White House official said.
Trump also gave a preview to his talks with Xi.
Trump is expected to demand that China curtail its dealings with Pyongyang and expel North Korean workers.
"You cannot support, you cannot supply, you cannot accept", Trump said. Beijing perceives the water mass, which is vital for its maritime trade and may become a major source of hydrocarbons in the future, as rightfully belonging to China.
"North Korea is a country ruled as a cult", the United States leader declared.
"I think we can say that so far, our measures have been relatively successful", comments Wu Xinbo with the Center for American Studies at Fudan University in Shanghai.