China on Wednesday lambasted US Secretary of State Mike Pompeo for sending a congratulatory message to Taiwan President Tsai Ing-wen on her inauguration, saying it was "extremely wrong, and it's also very dangerous".
Beijing views the island as part of its territory and has vowed to seize it by force if necessary.
"The US move... seriously interferes in China's internal affairs and seriously damages peace and stability in the Taiwan Strait," the defense ministry said in a statement.
Pompeo sent a message hailing Tsai for her "courage and vision in leading Taiwan's vibrant democracy" -- a rare direct message from a US official.
"It is extremely wrong, and it's also very dangerous," China's defense ministry said.
It warned that the People's Liberation Army had the "will, the confidence and the capability to defeat any form of external interference and the plot of 'Taiwan independence' separatist forces".
The statement said China would take "all necessary measures to firmly defend China's sovereignty and territorial integrity".
Tsai is loathed by Beijing because her party views Taiwan as a de facto sovereign state and not part of "one China".
In her inauguration speech, Tsai said China must find a way to live peacefully alongside a democratic Taiwan.
Since she first came to office in 2016, Beijing has rebuffed offers of talks and ramped up economic, military and diplomatic pressure on the island.