Taiwan President Tsai Ing-wen (C) is escorted by security staff before departing from Taoyuan airport on January 7, 2017.

Taiwan vowed on Tuesday to fight China's "increasingly out of control" behavior after Taipei lost another ally to Beijing when El Salvador became the third country to switch allegiances to China this year.

Taiwan now has formal relations with only 17 countries worldwide, many of them small, less developed nations in Central America and the Pacific, including Belize and Nauru.

Speaking in Taipei, President Tsai Ing-wen said Taiwan would not bow to pressure, describing El Salvador's decision as further evidence of China's efforts to squeeze the island, which have included regular Chinese bomber patrols around Taiwan.

"We will turn to countries with similar values to fight together against China's increasingly out-of-control international behavior," Tsai said.

Taiwan Foreign Minister Joseph Wu told reporters earlier that Taipei was not willing to engage in "money competition" with its giant neighbor.

He said El Salvador had been continuously asking for "massive funding support" since last year for a port development, but Taiwan was unable to assist with the "unsuitable project" after assessment.

"Pressure from China would only make Taiwan more determined to continue our path of democracy and freedom," he said.

"China's rude and unreasonable behavior will certainly have negative impact to cross-strait relations. This is also not how a responsible country should behave."

Beijing considers Taiwan to be a wayward province of "one China," ineligible for state-to-state relations, and has never renounced the use of force to bring the island under its control.

In Beijing, the Chinese government's top diplomat, State Councillor Wang Yi, said El Salvador had made the right decision.

"I'm confident that the people of El Salvador will feel the warmth and friendship of the Chinese people and derive tangible benefits from its cooperation with China," Wang told reporters alongside his El Salvador counterpart, Carlos Castaneda, shortly after the pair signed an agreement establishing ties.