The meeting between the leaders of the world's two largest economies was overshadowed by a rapidly escalating crisis in Syria after Trump ordered cruise missile strikes in response to the deadly chemical attack on the town of Khan Sheikhun.
China, which alongside Russia has repeatedly opposed UN resolutions against beleaguered Syrian President Bashar al-Assad.
According to officials, Trump informed Xi personally about the Syria strike.
The two leaders had a smile on their faces as they shook hands during their first face-to-face encounter.
More From This Section
"We had a long discussion already. So far, I have gotten nothing. Absolutely nothing. But we have developed a friendship. I can see that. I think, long-term, we are going to have a very, very great relationship and I look very much forward to it," Trump, 70, said as he hosted the 63-year-old Chinese Communist party leader and his spouse for a dinner.
Trump accepted an invitation Xi to pay a state visit to China in 2017, it said.
Both the leaders were wearing dark suits, with Trump donning a red tie, and Xi wearing a blue one. First Lady Melania Trump wore a red dress; while the Chinese first ladywas dressed in a bluish, pattern dress.
The dinner included steak and potatoes. Among the desserts were chocolate cakes with vanilla sauce and dark chocolate sorbet or a sorbet trio.
Despite his tough campaign talk, Trump has so far not followed through on his threat to formally brand China a "currency manipulator", nor to hit Chinese imports with punitive tariffs.
When Xi came to the US two years ago, Trump attacked the former president Barack Obama's red-carpet welcome, claiming he would have offered a Big Mac rather than a state dinner to a leader whose country he has accused of "raping" the American economy.
One of the most urgent issues for the US is North Korea, which on Wednesday fired a ballistic missile into the Sea of Japan.
Trump outraged China in December when he took the unorthodox step of accepting a phone call from the Taiwanese president. But the US president later agreed to respect the "One China" policy in a telephone call with President Xi in February.
Since establishing diplomatic relations in 1979, the two countries have witnessed twists and turns in their relationship, but have nonetheless become highly interdependent with their interests getting increasingly intertwined, China's state-run news agency Xinhua said.
China is now the largest trading partner of the United States. Last year, two-way trade reached USD 519.6 billion, compared to USD 2.5 billion in 1979.