(Bloomberg) -- Heading into 2019, Tsai Ing-wen looked at risk of becoming Taiwan’s first one-term president. Then came the unrest in Hong Kong.

Tsai had clawed back some ground in opinion polls before protesters started taking to the streets of Hong Kong in the hundreds of thousands in June. But the mass demonstrations there against China’s deepening encroachment have given her a noticeable boost ahead of Taiwan’s presidential elections in January.

As Taiwanese watch with concern the events in Hong Kong, particularly crackdowns on demonstrators, with scenes of police beating protesters huddled in balls on the floors of Hong Kong’s subways, Tsai’s firm stance on China has become her biggest selling point.

What happens in Hong Kong, including the way Beijing responds to protracted unrest, matters for democratically run Taiwan, which China considers part of its territory. The island’s leaders have often faced challenges in dealing with China, which is much bigger geographically, economically and militarily. There are risks at home from being seen as either too hard or too soft. And it was indeed her China policy that tripped Tsai up in the second half of last year.

Tsai’s refusal to endorse Beijing’s bottom line that both sides belong to “one China” -- sometimes called the 1992 Consensus -- while at the same time avoiding overt moves to assert Taiwan’s independence upset people on both sides of the spectrum. The upshot was a sense she had mismanaged the China issue.

Still, President Xi Jinping’s Jan. 2 speech -- he urged “in-depth democratic consultations” to work toward China’s long-held goal of unification and explicitly reaffirmed “one country, two systems” as his preferred model -- followed by the protests in Hong Kong have rallied support behind Tsai taking a stronger stance. She has said Taiwan will never unite with China as long as she’s in power.

In Taiwan’s last presidential election in 2016, Jamie Chiang voted for a candidate who promised a closer relationship with China. Come January, she will back Tsai.

“I am terrified Taiwan may become like Hong Kong if we accept the 92 Consensus,” the Taipei electronics company worker said. “I am worried we may lose our democracy, freedom, and everything we are used to because you can’t trust China.”

Tsai’s popularity sank as low as 15% after her Democratic Progressive Party fared poorly in local elections in November. Part of her falling approval was due to cuts in civil servant, teacher and military pensions, plus wage stagnation. Tsai stepped down as party chief, and there was chatter she could be dumped as its candidate for the election.

Before the pro-democracy protests erupted in Hong Kong, Tsai still lagged challenger Han Kuo-yu of the pro-China opposition Kuomintang by double digits in most opinion polls. Now, she leads Han by eight percentage points, according to a late August survey by broadcaster TVBS. Much of her support is from those under 40.

With an increasingly assertive Chinese leadership under Xi -- and a trade war threatening to split the world into competing spheres of Chinese and U.S. influence -- the presidential election is shaping up to be Taiwan’s most consequential since its first in 1996. The DPP favors eventually formalizing Taiwan’s independent status, thus making unification even harder.

Hong Kong was returned to Chinese rule in 1997 under an agreement with the U.K. that guaranteed the territory a “high degree of autonomy” until 2047. Beijing always saw the use of the model in Hong Kong as a test case for Taiwan. The two sides have been ruled separately since Chiang Kai-shek moved his Nationalist government across the Taiwan Strait during the Chinese civil war.

Tsai has been vocal on the turmoil in Hong Kong, speaking at least once a week via Facebook and Twitter in support of the demonstrators. She was the first leader to express concern over the arrests of prominent Hong Kong opposition figures. In a Facebook post in August, she vowed Taiwan would never become like Hong Kong as long as she’s president. And last week one of Hong Kong’s most well known pro-democracy activists, Joshua Wong, visited Taiwan and met with the DPP chairman.

Chiang, the Taipei resident, says she has mostly voted for KMT candidates in previous presidential elections, eager to maintain a harmonious cross-strait relationship since her father works in China and her sister-in-law is from the eastern Chinese province of Zhejiang. That changed with Hong Kong’s forceful response to the protests and what she sees as China’s willingness to violate international agreements.

“I don’t believe anything they say about one-country, two systems,” she said.

Concern in Taiwan over China’s response to the Hong Kong protest movement is showing up in its ubiquitous bubble tea shops. Some Taiwanese chains with mainland branches bowed to online pressure and voiced support for the view that Hong Kong and Taiwan are both part of China. Back in Taiwan, there have been countercampaigns to buy tea only from outlets that support the demonstrations.

China has used its economic leverage at times of political tension with a number of neighbors, and Taiwan is no exception. Since Tsai came to power Beijing has curbed the number of mainland tour groups allowed to visit and banned individual tourist travel entirely. Around 40% of Taiwan’s exports go to China and about 400,000 Taiwanese work there.

While the protests have given Tsai a boost other factors have helped, especially among younger voters, such as Taiwan’s economic resilience in the face of the U.S.-China trade war and a landmark decision to legalize same-sex marriage in May.

A Taiwan Mainland Affairs Council poll at the end of July showed the number of Taiwanese who support formal independence, either immediately or at a later date, rose to 26% -- more than double those who want unification. It also showed that almost 90% of respondents opposed “one country, two systems,” and about 65% supported protests in Hong Kong.

The hand of China has played out ahead of previous elections. The People’s Liberation Army conducted missile tests in the Taiwan Strait in 1996 in an unsuccessful effort to scare voters against voting for then-President Lee Teng-hui. Shortly before the 2016 poll, Chinese internet users pressured a 16-year-old Taiwanese member of a South Korean pop band into recording a video apologizing for appearing on a Korean TV show holding Taiwan’s flag.

Tsai’s victory is by no means assured, as two other high-profile figures continue to hint at presidential runs. Taipei city mayor Ko Wen-je, and the billionaire founder of iPhone assembler Foxconn, Terry Gou, have until mid-September to decide whether to run.

KMT challenger Han favors closer exchanges with China, but has been quiet about specific cross-strait policies since he won the party nomination. He plans to give a detailed account of his stance by the end-September, says political adviser Chao Chien-min. Chao stresses that Han disagrees with “one country, two systems.”

Han has previously described Taiwan and China as two partners in an “arranged marriage” who had fallen “madly in love” and said peace talks between the two were inevitable. He became the first elected official from Taiwan to visit Beijing’s liaison office -- the Communist Party’s outpost in Hong Kong -- during a trip there in March.

For Tsai, much may depend on how the Hong Kong protests play out.

“Even though Hong Kong’s protest has a decisive effect among the young generation in Taiwan in helping them form their political preferences for the first time, its effect among the older generation depends on how much the protest and the trade war influence China’s economy,” said Austin Wang, an assistant professor of political science at the University of Nevada. “It’s too early to say who will win in the end.”

To contact the reporters on this story: Cindy Wang in Taipei at hwang61@bloomberg.net;Miaojung Lin in Taipei at mlin179@bloomberg.net

To contact the editors responsible for this story: Rosalind Mathieson at rmathieson3@bloomberg.net, Samson Ellis

©2019 Bloomberg L.P.