In Panama, President Juan Carlos Varela announced the change, which entails breaking off formal relations with Taiwan, saying in a televised address that it represents the "correct path for our country".
In the statement, Trump's office said the two leaders had noted "the close economic, political, and security ties" between Taiwan and the United States, but the very contact threatened to upend nearly four decades of USA foreign policy.
"The Government of the Republic of Panama recognizes that there is but one China in the world, that the Government of the People's Republic of China is the sole legal government representing the whole of China, and that Taiwan is an inalienable part of China's territory", the statement read.
A joint communiqué was signed in Beijing between China's Foreign Minister Wang Yi and his Panama counterpart Isabel Saint Malo.
Taiwan Foreign Minister David Lee speaks at the Foreign Ministry in Taipei on June 13, 2017.
Beijing recently began the construction of a container port with natural gas facilities in Panama.
The new relationship with Beijing was starting Monday, and the previous one with Taiwan ending, the note added.
Chinese ships, after those from the United States, are the number two users of the Panama Canal, the Central American country's main source of budget revenue.
Taiwan's ministry of foreign affairs said in a statement that in breaking ties, President Varela had ignored the friendship between their countries and Taiwan's efforts to help Panama's development.
"It's about who can give the most".
Taiwan's government said it would not compete with China in what it described as a "diplomatic money game".
In December a year ago, the African island of Sao Tome and Principe made a similar move, trimming to 20 the number of countries that formally recognise Taiwan.
Taiwan reacted furiously to the latest move.
In Taipei, Joseph Wu, secretary general of the presidential office, said Tuesday morning Taiwan would rethink its relations with the mainland in the wake of Panama's decision.
"This kind of action is not only an open threat to Taiwanese people's survival and welfare but also an open provocation to peace and stability in the Taiwan strait and the region".
After years of heavy rhetoric, relations between China and Taiwan started improving in the 1980s.
In the past China and Taiwan had competed with each other to win diplomatic allies, wooing poorer countries with promises of aid and investment.