Chinese Foreign Minister Wang Yi and his Panamanian counterpart Isabel Saint Malo de Alvarado signed the communique in Beijing.
Panama switched diplomatic ties from Taiwan to China on Monday after more than a century of having only commercial relations with the Asian giant, the latest development in Beijing's drive to isolate the self-governing island it claims as its own territory.
Wang said he was sure relations between the countries would have a "bright future".
"In accordance with the interests and aspirations of the two nations, China and Panama chose to establish diplomatic relations from the moment of signing the relevant communique", the ministry's statement read.
China regards Taiwan as a breakaway province that it insists should be reunited with the mainland.
This April, Tsai met with Panama's ambassador to Taiwan, Alfredo Martiz Fuentes, thanking him for his contribution to strengthening relations between the two nations.
Flags of China (left) and Panama (right).
Taiwan's government said it was sorry and angry over Panama's decision, and said it would not compete with China in what it described as a "diplomatic money game".
Kumble set to remain India coach for Windies tour
Kumble re-applied despite being told he would get a direct entry into the pool. India play their first match against West Indies on June 23.
Following the decision, Taiwan's presidential office expressed "regret and dissatisfaction" with the Central American country and strongly condemned the move.
"The severance of ties between Panama and Taiwan was due to the lack of a breakthrough in cross-Taiwan Strait relations since the coming to power of the new government", Jou said, referring to President Tsai Ing-wen's (蔡英文) administration that took office on May 20, 2016.
China has a non-negotiable One-China policy and the government regards Taiwan as an integral part of it.
Taiwan's circle of diplomatic allies has been shrinking since it lost its United Nations seat to Beijing in 1971.
Beijing and Taipei have long competed to win diplomatic recognition, at times enticing small or poor countries with the promise of millions of dollars for public works projects.
The government recognised that there was "only one China" as it considers Taiwan part of it.
China is the second-biggest client of the Panama Canal and the leading provider of merchandise to a free-commerce zone in the Panamanian city of Colon.
Liao said he was not anxious about a domino effect among Taiwan's allies and instead urged the government to put more resources into maintaining the conveniences Taiwanese passport holders have around the world, saying that would be the most meaningful result of diplomacy for most Taiwanese.