A woman rides her bicycle holding a Spanish flag during Spain's National Day in Barcelona, Spain October 12, 2017. REUTERS/Gonzalo Fuentes

BEIJING (Reuters) - China understands and supports the Spanish government’s efforts to protect the country’s unity and territorial integrity, China’s Foreign Ministry said on Thursday, amid moves by Catalonia to declare independence.

The wealthy region’s intention to break away has plunged Spain into its worst political crisis since an attempted military coup in 1981, with Madrid threatening to sack the Catalan government if it goes ahead.

China was paying close attention, Foreign Ministry spokeswoman Hua Chunying told a daily news briefing.

China “understands and supports the Spanish government’s efforts to protect national unity ... and its territorial integrity,” Hua said.

China believes Spain has the ability to guarantee social order and people’s interests in accordance with the law, she added.

China says it adheres to a policy of non-interference in other countries’ internal affairs, but it generally takes a dim view of independence or secessionist movements around the world.

At home, it contends with what it says are separatist movements in its western regions of Tibet and Xinjiang, and also insists that the self-ruled island of Taiwan belongs to China.

Though it generally remains officially agnostic on such issues abroad, Beijing has expressed more openness toward independence votes when both sides have agreed to them, such as Scotland’s unsuccessful 2014 referendum to leave the United Kingdom, and South Sudan’s 2011 vote in favor of independence from Sudan.