Beijing@ (Fixes typo in headline)
* Taiwan says not prepared to play dollar diplomacy
* Taipei says setback will not hinder international presence
* El Salvador sees great benefits in Beijing link
* Taiwan loses 5 allies since 2016
TAIPEI/BEIJING, Aug 21 (Reuters) - Taiwan vowed on Tuesday to fight China's "increasingly out of control" behaviour 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 just 17 countries worldwide, many of them smaller, less developed nations in Central America and the Pacific like Belize and Nauru.
Speaking in Taipei, President Tsai Ing-wen said Taiwan will not bow to pressure, describing the El Salvador move 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 behaviour," Tsai said.
Taiwan Foreign Minister Joseph Wu told reporters earlier that Taipei was not willing to engage in "money competition" with its giant neighbour.
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 behaviour will certainly have negative impact to cross-strait relations. This is also not how a responsible country should behave."
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.
Separately, El Salvador's President Salvador Sanchez Ceren announced in a nationally televised speech that his government had broken off diplomatic relations with Taiwan and instead established new diplomatic ties with China.
Sanchez Ceren said the central American country, which built ties with the Republic of China government in 1933, would see "great benefits" and "extraordinary opportunities" in the new relationship with Beijing.
Taiwan's formal name is the Republic of China, whose government fled to Taiwan in 1949 after losing a civil war with the Communists.
"We are convinced this is a step in the right direction that corresponds to the principles of international law of international relations and the inevitable trends of our time," he said.
In Beijing, Castaneda said it was a strategic decision his government made to "create conditions to change the historical standing of our country and to really elevate the livelihood of our people".
Taiwan has accused China of luring its friends away with offers of generous aid packages. China denies this, and says Taiwan is a part of China with no right to formal diplomatic ties with any other country.
The news comes as Tsai wrapped up a high-profile trip to Latin America, including stops in the United States, that drew anger from China.
"China will not get unification with Taiwan by luring away our allies. What China did was to humiliate Taiwan repeatedly without getting any respect from Taiwan's people," Taiwan's ruling Democratic Progressive Party wrote in a statement.
El Salvador is the fifth country Taiwan will lose as a diplomatic ally since Tsai came to office in 2016, following Burkina Faso, the Dominican Republic, Sao Tome and Principe and Panama.
Ahead of next month's summit between China and African leaders in Beijing, China has also been upping the pressure on Taiwan's last remaining ally on the continent, eSwatini, to come over to China's side, diplomatic sources say.
China's hostility to Taiwan has grown since Tsai's election as Beijing fears she wishes to push for the island's formal independence, a red line for China. She says she wants to maintain the status quo but will defend Taiwan's democracy.
(Reporting By Jessica Macy Yu, Yimou Lee in Taipei, Philip Wen and Ben Blanchard in Beijing and Nelson Renteria in San Salvador; Writing by Anne Marie Roantree; Editing by Michael Perry)