US President Donald Trump (R) and China's President Xi Jinping (L) along with members of their delegations, hold a dinner meeting at the end of the G20 Leaders' Summit in Buenos Aires, on December 01, 2018.

History shows that cooperation is the best choice for both China and the United States, Chinese President Xi Jinping told U.S. President Donald Trump in a congratulatory message on Tuesday to mark 40 years since the establishment of diplomatic relations.

The two countries agreed last month to a 90-day temporary ceasefire in their bitter trade war to give them time to hold fresh talks to try and end a dispute that has seen them level increasingly severe tariffs on each others' goods.

In his message to Trump, Xi said China-U.S. relations have experienced ups and downs but have made historic progress over the past four decades, state news agency Xinhua said.

This has brought huge benefits to the two peoples and has contributed greatly to world peace, stability and prosperity, Xi added.

"History has proved that cooperation is the best choice for both sides," Xi said.

Sino-U.S. relations are in an important stage, he added.

"I attach great importance to the development of China-U.S. relations and am willing to work with President Trump to summarise the experience of the development of China-U.S. relations and implement the consensus we have reached in a joint effort to advance China-U.S. relations featuring coordination, cooperation and stability so as to better benefit the two peoples as well as the people of the rest of the world," he said.

Trump sent his own congratulatory message in return, saying it was his priority to promote cooperative and constructive U.S.-China relations, Xinhua added.

Xi and Trump also spoke by telephone over the weekend. Trump said he had a "long and very good call" with Xi and that a possible trade deal between the United States and China was progressing well.

China and the United States have made plans for face-to-face consultations over trade in January, China's Commerce Ministry said last week.

Xinhua, in a commentary, said it was only natural the two countries would have disagreements and encounter problems, considering their "different social systems, development paths and historical and cultural backgrounds."

"At a time when the world is undergoing unprecedentedly profound changes and is fraught with risks and uncertainties, the global community expects even closer collaboration between the two largest economies," it said.

This year marks a series of sensitive anniversaries for China, including, in June, 30 years since the bloody crackdown on pro-democracy demonstrators in and around Beijing's Tiananmen Square.

On Wednesday, Xi will make his first public appearance at an anniversary-related event, giving a speech about self-ruled Taiwan, which China claims as its sacred territory, on the 40th anniversary of a key policy statement that led to a thaw in relations with the island.