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.
This is perhaps the biggest blow Taiwan has suffered since relations with Beijing began deteriorating last year.
Beijing's luring away of Panama is due to political rather than economic reasons. China could have continued investing in Panama without official ties.
Beijing has lost patience with Tsai Ing-wen, suspecting her of trying to wean Taiwan away from the mainland, economically and politically, with the aim of independence.
So China has raised the pressure, cutting off dialogue with Ms Tsai's administration and reducing the number of Chinese tourists visiting Taiwan. It's also keeping Taiwan out of international and regional groups.
Beijing's moves may strengthen anti-unification sentiment in Taiwan, but it sees not losing Taiwan as a crucial part of its national identity and seems willing to take this risk.
If the current stalemate continues, Taiwan risks further economic and political isolation.