BEIJING/TAIPEI (Reuters) - A threat by a senior Chinese diplomat to invade Taiwan the instant any U.S. warship visits the self-ruled island has sparked a war of words, with Taipei accusing Beijing of failing to understand what democracy means.

FILE PHOTO: A pro-China supporter adjusts a China national flag during a rally calling for peaceful reunification, days before the inauguration ceremony of President-elect Tsai Ing-wen, in Taipei, Taiwan May 14, 2016. REUTERS/Tyrone Siu

China considers Taiwan to be a wayward province and has never renounced the use of force to bring it under its control. The United States has no formal ties with Taiwan but is bound by law to help it defend itself and is its main source of arms.

Beijing regularly calls Taiwan the most sensitive and important issue between it and the United States. In September, the U.S. Congress passed the National Defense Authorization Act for the 2018 fiscal year, which authorises mutual visits by navy vessels between Taiwan and the United States.

At a Chinese embassy event in Washington on Friday, diplomat Li Kexin said he had told U.S. officials that China would activate its Anti-Secession Law, which allows it to use force on Taiwan if deemed necessary to prevent the island from seceding, if the United States sent navy ships to Taiwan.

“The day that a U.S. Navy vessel arrives in Kaohsiung is the day that our People’s Liberation Army unifies Taiwan with military force,” Chinese media at the weekend quoted Li as saying, referring to Taiwan’s main port.

Taiwan’s Foreign Ministry said late on Saturday that, while Chinese officials seemed to want to try and win over hearts and minds in Taiwan, they also had been repeatedly using threats that hurt the feelings of Taiwan’s people.

“These methods show a lack of knowledge about the real meaning of the democratic system and how a democratic society works,” the ministry said.

China suspects Taiwan President Tsai Ing-wen, who leads the independence-leaning Democratic Progressive Party, wants to declare the island’s formal independence. Tsai says she wants to maintain peace with China but will defend Taiwan’s security.

Relations between China and Taiwan were becoming even more complex and severe, Zhang Zhijun, head of China’s policy-making Taiwan Affairs Office, told a visiting delegation of the New Party, a small pro-China Taiwan opposition party on Monday.

Taiwan independence forces are trying to root out Chinese culture in Taiwan and are the gravest threat to peace and stability in the Taiwan Strait, the official Xinhua news agency cited Zhang as saying.

China will never back down over Taiwan, influential Chinese tabloid the Global Times, published by the ruling Communist Party’s official People’s Daily, said earlier on Monday.

“Li’s words have sent a warning to Taiwan and drew a clear red line,” it said in an editorial.

“If Taiwan attempts to hold an independence referendum or other activities in pursuit of de jure ‘Taiwan independence’, the PLA will undoubtedly take action.”

China would continue to maintain the principle of peaceful unification, foreign ministry spokesman Lu Kang said on Monday.

“At the same time, we will resolutely safeguard national sovereignty and territorial integrity,” he told reporters.