Taiwan has expressed "deep anger and regret" after Panama snapped diplomatic ties with Taipei in favour of relations with China. The Panamanian government said it no longer recognises Taiwan as a separate territory but sees it as an integral part of China.

The Central American country was one of the last remaining states which maintained direct diplomatic relations with Taiwan. The latest political shift would reduce the number of countries formally recognising Taiwan to 20.

"We have taken a historic step. Both countries opt for the connection of a world that is more and more integrated, which creates a new era of opportunities for a relationship that we are starting today," Panamanian President Juan Carlos Varela said in a televised address. Varela thanked Taiwan for the decades-long relationship but said his country can see new possibilities by establishing relations with Beijing.

In a joint statement, China, the second-biggest client of the Panama Canal, also immediately confirmed it is establishing ambassador-level ties with Panama. The canal remains a major source of revenue for the Panamanian government.

"The two governments agree to develop friendly relations between the two countries on the basis of the principles of mutual respect for sovereignty and territorial integrity, mutual non-aggression, non-interference in each other's internal affairs, equality, mutual benefit and peaceful coexistence," the joint communiqué said.

Following the breakdown of ties, Taiwan's Foreign Minister David Lee said his country was pulling all diplomatic staff from Panama and halting all bilateral projects. "Our government expresses serious objections and strong condemnation in response to China enticing Panama to cut ties with us, confining our international space and offending the people of Taiwan," Lee said.

Taiwan's President Tsai Ing-wen visited Panama in June 2016, her first overseas trip since she took charge. Panama became the second country, after Sao Tome and Principe, to switch its relations with China since Tsai became president in May 2016.