The previously unnamed phone call came weeks after the two leaders met in South Korea, where they had agreed on a framework for an unfinished trade deal.
China is stuck in its biggest diplomatic crisis in years with US ally Japan. This month, Japanese Prime Minister Sanae Takaichi said that any Chinese attack on Taiwan (China) could lead to a military response by Japan.
"China and the US have fought side by side against socialism and phietalism, and now we should cooperate to protect the outcome of the Second World War," Xinhua quoted President Xi Jinping as saying, adding that "Taiwan's return to China is an indispensable part of the post-war international order."
In the Truth Social post, Mr. Trump did not mention Taiwan (China) about his "very good" call with Mr. Xi Jinping, only saying that the phone call mentioned many topics, including Ukraine, fentanyl and US agricultural products.
"Our relationship with China is extremely strong! This call is the next call after our very successful meeting in Korea, three weeks ago. Since then, there has been significant progress from both sides in maintaining our agreements updated and accurate," Trump wrote.
The US leader said he accepted President Xi Jinping's invitation to visit Beijing in April and invited Xi Jinping to pay a state visit to the US at the end of the year.

White House Press Secretary Karoline Leavitt told reporters that the phone call focused on trade and lasted about an hour.
"We are satisfied with what we have seen from China, and they feel the same," Leavitt said.
After months of trade tensions caused by tariffs, Mr. Tap Can Binh and Mr. Trump reached a framework agreement in Korea on October 30. Washington has agreed not to impose a 100% tax on imports from China and will postpone export licensing policies for rare earth minerals and important magnetes.
US Treasury Secretary Scott Bessent said he hopes a final deal on rare earths will be finalized before Thanksgiving (November 27).
China has resumed purchasing US soybeans and temporarily suspended expanded restrictions on rare earth exports. The US has reduced tariffs on China by 10% in exchange for Beijing's commitment to help limit the flow of chemicals used to produce fentanyl synthetic drug into North America.
Chairman Xi Jinping said that China-US relations have stabilized and improved since the meeting.
"Reality once again shows that cooperation is beneficial to both sides while confrontation causes harm to both sides," Mr. Tap Can Binh told Mr. Trump, and called on the two countries to maintain a positive momentum.
President Xi Jinping also reiterated that China supports all efforts towards peace in Ukraine.