The meeting was the first face-to-face encounter between the leaders in more than a year, a period that saw Trump impose tariffs on billions of dollars in Chinese imports in a bid to force Beijing to halt trade practices the USA considers unfair.
The two presidents agreed that the two countries "can and should" ensure success of China-U.S. relations and that coordination, cooperation and stability should be the defining features of bilateral relations, said the Chinese official. They have also agreed to exchange visits at the appropriate time.
On economic and trade issues, Xi said that it is very normal that the two countries have some disagreements in the fields of economy and trade, adding that the key is to manage their differences properly and work out a solution acceptable to both sides in the spirit of mutual respect, equality and mutual benefit.
A limited truce was reached in that war, as the two leaders agreed not to escalate - not to add new tariffs - after January 1, 2019.
United States officials insist that the American economy is more resilient to the tumult than China's, but they remain anxious of the economic effects of a prolonged showdown - as Trump has made economic growth the benchmark by which he wants his administration judges.
The statement included the leaders' commitment to an open and flexible financial system based on agreed worldwide standards, finalization of the agreed financial reform agenda and an assessment of its impact.
The US decision to agree to a delay in the imposition of the tariffs formerly scheduled for January 1 might yet be seen as a successful application of leverage.
"If it happens, it goes down as one of the largest deals ever made", Trump said of the potential deal.
Investors have been holding their breath about the meeting between Trump and Xi as any consensus over trade can bring some relief to global markets.
China has already slapped tariffs on $110 billion in US goods.
The declaration said the multilateral trading system is now falling short of its objectives and there is room for improvement.
G20 declaration stresses fair, sustainable development
Prior to Trump's meeting with Xi, Stanley Chao, managing director of California-based All in Consulting, which assists Western companies in developing business in Asia, told Newsweek that he believed Trump needed "a win after the midterm elections", suggesting that the president would need to compromise.
Trump has imposed import taxes on $250 billion in Chinese products.
He suggested that the "incredible relationship" he and Xi had established would be "the very primary reason" they could make progress on trade.
Trump described the meeting with Xi as "amazing and productive".
The White House said Xi, "in a wonderful humanitarian gesture", had agreed to designate fentanyl a controlled substance.
Xi, according to the White House, also told Trump he is open to approving the previously unapproved $44 billion bid by American semiconductor and telecommunication equipment manufacturer Qualcomm to purchase Dutch semiconductor maker NXP should the deal again be presented to him.
Trump, who in recent months has harshly criticized China and accused it of meddling in USA elections, in the statement called his meeting with Xi "amazing and productive".
G20 nations were still struggling to agree on the wording for the summit's communique on major issues including trade, migration and climate change, which in past years have been worked out well in advance.
The economic heavyweight warned that otherwise global growth could slow.
The dust has settled in the trade war between the United States and China.
Sound China-U.S. relations, Xi said, are in line with the fundamental interests of the two peoples and the broad-based expectations of the worldwide community.
Exports of Fentanyl from China became the latest source of friction between the two countries as it has emerged as a new source of drug abuse in the USA in addition to heroin, resulting in large scale deaths of American youth.
Merkel's plane makes emergency landing on way to G20
Video from on board shows several fire engines surrounding the Airbus after it landed. Merkel will now travel to the G20 with a vastly slimmed-down delegation.