Chinese Foreign Minister Wang Yi and his Panamanian counterpart Isabel de Saint Malo, who is also Panama's Vice President, signed the joint communique.
According to the communique quoted by Xinhua news agency, China and Panama will establish diplomatic relations at the ambassadorial level.
It also said that Panama had severed "diplomatic relations" with Taiwan and undertook not to have any more official relations or exchanges with Taipei.
To the south of China, Taiwan is an English-speaking democracy, which Beijing sees it as a breakaway province.
After being defeated by the Communists in 1949, Chiang Kai-shek fled to Taiwan, better known as Formosa for hundreds of years.
Since then Taiwan, which means beautiful land, has maintained a sort of independence from China but never proclaimed it.
Ties between China and Taiwan took a hit last year when the island elected Tsai-Ing We, whose Democratic Progressive Party has been traditionally pro-independence.
China vows to unite the island with the mainland even if it came to resorting to violence.
The latest development will certainly bolster China's claim over Taiwan.
Beijing does not mince words in slamming or threatening any country which tries get close to Taiwan.
(This story has not been edited by Business Standard staff and is auto-generated from a syndicated feed.)