When a small band of protesters sacked the building that houses Hong Kong’s legislature on Monday, the dramatic escalation was being closely watched far beyond the city’s borders.

The activists involved wanted to send a message to mainland China – by defacing representations of Beijing and putting up British colonial-era flags, they made it abundantly clear against whom their actions were directed.

But the crisis in Hong Kong that has seen millions take to the streets in recent weeks is also proving to be of huge significance to another territory with a complicated relationship to the Chinese mainland.

Taiwan, claimed by China but operating practically as an independent country, is gearing up for presidential elections in 2020 that could define the direction the island takes when it comes to the all-important question of ties to Beijing.

The territory has long resisted the “one country, two systems” principle under which the other former colonised states Hong Kong and Macao now operate.

Aftermath of protesters storming Hong Kong government HQ: In pictures Show all 15 1 /15 Aftermath of protesters storming Hong Kong government HQ: In pictures Aftermath of protesters storming Hong Kong government HQ: In pictures The lobby of the Legislative Council building in Hong Kong is seen covered in graffiti after it was stormed by protesters Getty Aftermath of protesters storming Hong Kong government HQ: In pictures Police officers stand guard at the Legislative Council building in Hong Kong after it was stormed by protesters EPA Aftermath of protesters storming Hong Kong government HQ: In pictures The colonial flag of Hong Kong hangs in the chamber of the Legislative Council after protesters stormed the building Reuters Aftermath of protesters storming Hong Kong government HQ: In pictures Police officers are seen behind cracked glass panels that were damaged by protesters trying to ram their way into the Legislative Council building EPA Aftermath of protesters storming Hong Kong government HQ: In pictures Shattered glass is seen on the outside wall of the Legislative Council of Hong Kong after protesters smashed their way in the building AP Aftermath of protesters storming Hong Kong government HQ: In pictures Riot police patrol the Legislative Council building in Hong Kong after it was stormed by protesters Getty Aftermath of protesters storming Hong Kong government HQ: In pictures Police officers inspect damage to the Legislative Council building in Hong Kong after it was stormed by protesters AFP/Getty Aftermath of protesters storming Hong Kong government HQ: In pictures A caricature of Hong Kong leader Carrie Lam is pasted on a pillar outside of the Legislative Council after protesters broke into the building Reuters Aftermath of protesters storming Hong Kong government HQ: In pictures Graffiti is seen in the chamber of the Legislative Council in Hong Kong after protesters stormed the building Getty Aftermath of protesters storming Hong Kong government HQ: In pictures Abandoned placards and litter is seen outside the Legislative Council building in Hong Kong after a protest on July 1 EPA Aftermath of protesters storming Hong Kong government HQ: In pictures A painting hung i the Legislative Council in Hong Kong is covered in graffiti after protesters stormed the building Getty Aftermath of protesters storming Hong Kong government HQ: In pictures A lift in the Legislative Council building is seen covered in graffiti and litter after protesters stormed the building Getty Aftermath of protesters storming Hong Kong government HQ: In pictures The chamber of the Legislative Council in Hong Kong after protesters stormed the building Getty Aftermath of protesters storming Hong Kong government HQ: In pictures A desk in the chamber of the Legislative Council in Hong Kong is covered in graffiti after protesters stormed the building AFP/Getty Aftermath of protesters storming Hong Kong government HQ: In pictures An area inside the Legislative Council building complex is strewn with litter and smashed glass after it was stormed by protesters Getty

Now, after weeks of violent clashes over a proposed extradition law seen by Hong Kong people as a way for China to encroach on their treasured independent legal system, even Taiwan’s pro-Beijing parties are starting to distance themselves from the “One China” concept.

Growing anti-Beijing sentiment has seen the poll lead of the traditionally pro-China Kuomintang party slashed.

Ten days ago the businessman Terry Gou, who made much of his fortune assembling electronics on the mainland, played down his China links and told reporters: “‘One country, two systems’ has failed in Hong Kong.” Taiwan’s president Tsai Ing-wen won her party’s nomination for 2020 last month, and analysts suggested that it was the image of Tsai’s firm stance to protect Taiwan’s sovereignty from China that gained a lot of people’s support.

Some Taiwanese fear that if Beijing is successful in its hardening stance on Hong Kong then Taiwan will be next.

And it is certainly an underlying theme from interviews with protesters over the past weeks that they feel pushed to make a final stand – that after years of encroachment into Hong Kong’s autonomy, this is the hill they are willing to die on.

China and the pro-Beijing government of Hong Kong chief executive Carrie Lam have sought to paint the activists who stormed the legislative council as criminals, a radical faction ideologically distant from the hundreds of thousands who joined a peaceful march on the anniversary of the handover of power from Britain.

Yet regardless of how much public property they damaged or how many police officers they may have injured, they will be viewed on with a sympathetic eye from a Taiwanese public who fear Hong Kong represents a glimpse of the future – if they go down the path of accepting Chinese rule.

“The key is not what the protesters did or did not do, but why Hong Kong’s people are being put into the situation they find themselves in and what this means for Taiwan,” Professor Steve Tsang, director of the Soas China Institute, told The Independent.

“If this is the prospect of Chinese sovereignty, Taiwan does not want any [part] of it,” he said.

The pro-democracy movement in Taiwan is not letting slip an opportunity to make its point. Cho Jung-tai, chair of the ruling Democratic Progressive Party, said the protests in Hong Kong “reflects the complete failure of the ‘one country, two systems’ model”.

This will be seen as a major escalation, I can see Beijing triggering plan B, taking control in Hong Kong and using Lam as a puppet Professor Steve Tsang, Soas

Referring to the protests during a trip to Washington DC, he said they showed that “there is a tough battle to be fought to safeguard our beloved Taiwan”.

“The protests, and the way they have been handled by the Hong Kong government, will likely make closer relations between Taiwan and the mainland even less attractive in the eyes of many Taiwanese,” said Dr Mareike Ohlberg, research associate at the Mercator Institute for China Studies (Merics) in Berlin.

Dr Klavier Wang, a Hong Kong-based academic specialising in national identity and the territory’s parallels with Taiwan, said there were already echoes of Hong Kong’s protest movement in a rally held in Taipei on 23 June, when tens of thousands marched against the so-called “red media” – pro-Beijing news organisations such as The China Times.

The protests, and the way they have been handled by the Hong Kong government, will likely make closer relations between Taiwan and the mainland even less attractive in the eyes of many Taiwanese Dr Mareike Ohlberg, Mercator Institute for China Studies

Monday’s protests would likely further galvanise support for pro-democracy parties ahead of the election, she said, “given Taiwan’s people can see Hong Kong is experiencing a dire political crisis at this juncture, 22 years after handover”.

Many analysts have suggested the nature of Monday’s occupation of the legislative council, and the challenge to the authority which the building represents, could force Beijing to harden its attitude to Hong Kong – and its defence of the “one country, two systems” principle.