Panama has cut long-standing diplomatic ties with Taiwan and established relations with China, in a diplomatic coup for Beijing.
The Panamanian government said it recognised there was "only one China" and considered Taiwan part of it.
Taiwan expressed "anger and regret", and accused Panama of "bullying".
China regards Taiwan as a breakaway province. A few countries maintain ties with Taipei instead of Beijing, and Panama is the latest to switch sides.
In December last year, the African island nation of Sao Tome and Principe made a similar move. Now only 20 countries have diplomatic relations with Taiwan.
In recent years China has intensified its economic investment into the Central American country - home of the economically vital Panama Canal.
Taiwan's foreign ministry said in a statement that it expressed "anger and regret" over what it called a "very unfriendly" diplomatic turn by Panama that "yielded to economic interests by the Beijing authorities".
It accused Panama of "bullying" Taiwan while "ignoring the many years of friendship" between the two countries, and added it would "not compete with the Beijing authorities for money diplomacy".
It was as recently as June last year that Taiwan's leader Tsai Ing-wen visited Panama, on her first overseas trip as president.
Following Panama's announcement, China's state media published photos of the two countries' foreign ministers in Beijing signing a document establishing diplomatic relations and toasting with champagne.
Panamanian President Juan Carlos Varela said in a televised address that he was "convinced that this is the correct path for our country".
China's foreign ministry also released a statement (in Chinese) saying that "the Chinese government and its people highly appreciate and warmly welcome" the move by Panama.
The United Nations in 1971 switched diplomatic recognition to Beijing's People's Republic of China (PRC) and most countries have since followed that lead in order not to antagonise the resurging economic giant.
Many of Taipei's remaining backers are small island states or in Central and South America - regions that in the past had limited economic ties with China.
Given China's rapid growth as an economic and political superpower, it has been increasingly easy for Beijing to sway countries to its side.
In the case of Sao Tome and Principe, Taiwan's foreign ministry condemned the move, alleging the island nation had demanded a huge amount of financial support.
Panama did not give any reason for changing its diplomatic allegiance but there has been growing economic co-operation with China in recent years.
Chinese companies are developing ports in Panama, and Chinese state firms are said to have expressed interest in developing the land around the Panama Canal once the country opens a tender for it later this year.
The Panama Canal is a vital shipping route. As China expands its global trade ambitions with its One Belt One Road infrastructure-building initiative, access to the eastern coasts of both South America and the US is expected to be of growing importance for Beijing.
The switch by Panama leaves Taiwan with 11 allies in Latin America and the Caribbean. These are Belize, El Salvador, Haiti, Nicaragua, St Kitts and Nevis, St Vincent & the Grenadines, the Dominican Republic, Guatemala, Paraguay, Honduras and Saint Lucia.
In Africa, it has ties with Burkina Faso and Swaziland and in Europe, with the Holy See. In the Pacific, it has diplomatic relations with Kiribati, Nauru, the Solomon Islands, Tuvalu, the Marshall Islands and Palau.