BEIJING (Reuters) - The failure of Catalonia’s effort to declare independence shows that Taiwan independence is also doomed to fail as national unity is paramount for all countries, a Chinese official said on Wednesday.

A rainbow is seen behind Taiwanese flag during the National Day celebrations in Taipei, Taiwan, October 10, 2017. REUTERS/Tyrone Siu

China takes a dim view of independence or secessionist movements around the world, while saying it adheres to a policy of non-interference in other nations’ internal affairs. Beijing has said it opposes any actions to split Spain.

Last month Madrid assumed direct rule over Catalonia after the Spanish prime minister sacked the region’s secessionist government which had declared independence from Spain following an attempted referendum.

The issue is particularly sensitive for China because of the status of self-ruled and democratic Taiwan, claimed by China as its inherent territory, but where many people would like to proclaim formal independence, a red line for Beijing.

The failure of Catalonia’s independence bid was a good thing, said Ma Xiaoguang, the spokesman of China’s policy-making Taiwan Affairs Office.

“The failure of the Catalonia referendum fully shows that protecting national sovereignty and territorial integrity is a paramount national interest for east or west,” Ma told a regular news briefing. “So Taiwan independence is doomed to failure.”

Relations between Beijing and Taipei have nosedived since the island elected Tsai Ing-wen as president last year.

China believes she wants formal independence for Taiwan. Tsai says she wants to maintain peace with China, but will defend Taiwan’s democracy and security.

China has suspended a regular dialogue mechanism with Taiwan, stepped up military drills around the island and sought to squeeze its international space by siphoning off Taiwan’s remaining diplomatic allies.

This week, Taiwan said its environment minister had been prevented from attending an annual U.N. climate meeting in Germany, despite credentials as a non-governmental participant, due to pressure from China.

Ma said Taiwan had itself to blame for the poor state of ties and its inability to participate in events such as the climate talks.

“The Taiwan side shouldn’t put blame on others while they themselves are to blame, and should earnestly reflect on things,” he added.