TAOYUAN, Taiwan (Reuters) - Taiwanese President Tsai Ing-wen headed for the United States on Thursday on a trip that has angered Beijing, warning that democracy must be defended and the island faced threats from "overseas forces", in a veiled reference to China.

China, which claims self-ruled and democratic Taiwan as its own and views it as a wayward province, has called on the United States not to allow Tsai to transit there on her overseas tour.

She is spending four nights in the United States in total, two on the way there and two on the way back on a visit to four Caribbean allies. Tsai will go to New York on her way there, and then is expected to stop in Denver on the way back.

Tsai was last in the United States in March, but her stops this time will be unusually long, as normally she spends just a night at a time in transit.

The U.S. State Department has said there had been no change in the U.S. "one-China" policy, under which Washington officially recognizes Beijing and not Taipei, while assisting Taiwan.

However, analysts said the extended stopovers served to emphasize the Trump administration's support for Tsai at a time when she has been coming under increasing pressure from Beijing, a major U.S. security rival with which Washington has been engaged in a year-long trade war.

Speaking at Taipei's main international airport at Taoyuan, Tsai said she would share the values of freedom and transparency with Taiwan's allies, and she was looking forward to finding more international space for Taiwan.

"Our democracy has not come easily, and is now facing threats and infiltration from overseas forces," Tsai said, without naming any such force.

"These challenges are also common challenges faced by democracies all over the world. We will work with countries with similar ideas to ensure the stability of the democratic system."

Taiwan has been trying to shore up its diplomatic alliances amid pressure from China. Beijing has been whittling down Taipei's few remaining diplomatic allies, which now total only 17 countries, almost all small Central American and Pacific nations.

Tsai will also be visiting St Vincent and the Grenadines, St Lucia, St Kitts and Nevis, and Haiti.

She was due in New York on Thursday afternoon and will meet members of the Taiwanese community and U.N. ambassadors of allied countries.

The U.S. State Department described Tsai's visit as "private and unofficial" and said she would be greeted in New York by James Moriarty, chairman of the American Institute in Taiwan, the de facto U.S. embassy in Taipei. It did not respond when asked if she would have contacts with any other U.S. officials.

Seeking to bolster Taiwan's defenses, the United States this week approved an arms sale worth an estimated $2.2 billion for Taiwan, despite Chinese criticism of the deal.

Tsai, who faces re-election in January, has repeatedly called for international support to defend Taiwan's democracy in the face of Chinese threats.

Beijing has regularly sent military aircraft and ships to circle Taiwan on drills in the past few years.

Tsai stopped over in Hawaii in March at the end of a Pacific tour.

Douglas Paal, who served as U.S. representative to Taiwan from 2002 to 2006, said Tsai's extended stopovers showed U.S. approval for the "caution and restraint" she had shown in her dealings with Beijing.

"It makes sense to reinforce that with generous transit treatment," he said. "This is also ... a message to China. The U.S. government believes Tsai is behaving responsibly in respecting the framework of U.S.-China-Taiwan relations."

Paal said the Trump administration had yet to indicate a significant shift in the traditional U.S. approach to Taiwan, but this could change in the event of a deterioration of U.S. relations with Beijing.

"It’s like an engine running at a high idle," he said. "Trump has not engaged the gears, but there is a lot of activity at lower levels seeking to upgrade relations. So change has not occurred in a big way yet, but it could happen at any time. With unpredictable consequences."

(Reporting by I-Hwa Cheng; Additional reporting by Yimou Lee in Taipei and David Brunnstrom in Washington; Writing by Ben Blanchard; Editing by James Dalgleish)