Beijing called him a "troublemaker" and a dangerous "separatist". Now he will be Taiwan's next president.
China's claims over Taiwan are not new - it sees the island as part of its territory and Xi Jinping has made unification a goal. But the threats have ramped up in the past year.
And yet, despite renewed warnings from China against voting for the ruling Democratic Progressive Party (DPP), millions of Taiwanese headed to the polls under warm, sunny skies on Saturday to do just that.
They picked their 64-year-old vice-president, a doctor-turned politician, William Lai Ching-te, to lead Taiwan through its testy relationship with China.
It's an unprecedented third term for the DPP, a party China sees as skirting too close to its unquestionable red line - Taiwanese independence.
How Mr Lai manages Beijing, and how Beijing reacts to him, will determine his presidency.
Tsai 3.0 - or a fresh start?
Mr Lai has promised that his term will be a continuation of the eight years of his predecessor, Tsai Ing-wen.
Even in his Saturday address, he chose his words carefully and offered dialogue and co-operation.
On the campaign trail he has repeated her formula over and over that there is "no need to declare independence, because Taiwan is already an independent sovereign state - its name is the Republic of China - Taiwan".
However, Mr Lai has long been considered much more of a firebrand than the cautious President Tsai.
He came up through the DPP's ranks as a member of the "new wave" faction, which advocated the formal declaration of Taiwan independence.
Mr Lai and his running mate Hsiao Bi-khim are deeply disliked and mistrusted by Beijing, which has banned them both from travel to mainland China and Hong Kong.
Ms Hsiao, the daughter of an American mother and a Taiwanese father, was most recently Taiwan's representative to the US.
So China is extremely unlikely to agree to any dialogue with the new president. The two sides have had no formal communication since 2016. China suspended the channel at the time, infuriated by Ms Tsai's refusal to acknowledge that Taiwan was a part of the mainland.
Saturday's verdict will also mean a continuation of the very tense situation that already exists in the Taiwan Strait, with almost daily intrusions by Chinese ships and military aircraft.
Beijing could signal its discontent with a big show of military force, as it did after US House Speaker Nancy Pelosi visited Taipei in 2022. Taipei accused it then of mimicking a near blockade of the island.
China may also step up economic and diplomatic pressure, by luring away more of the handful of small states that still recognise Taiwan, and sanctioning more Taiwanese companies, products and people.
Mr Lai's strategy for facing down the Chinese military threat is to continue what Ms Tsai has done.
He has promised to spend more on Taiwan's military, continue the indigenous submarine building programme, and to build an even closer relationship with the United States, Japan and Europe. Ms Tsai has especially built a strong relationship with Washington.
But there will be some concern in the US that a Lai presidency could be more provocative, given his background as a pro-independence politician.
However his running mate Ms Hsiao is a reassurance to the Biden administration. She is likely to take the lead in persuading the US that Mr Lai can be trusted not to provoke Beijing.
'Xi Jinping needs to learn to be quiet'
No matter how carefully Mr Lai plays his cards, Beijing cannot ignore the message his win sends.
Polls suggested it was a very close race but the DPP won by a much wider margin than expected.
"They are saying to China we won't listen to you any more, our future will be determined by ourselves, so Xi Jinping needs to learn to be quiet during our election," one younger DPP supporter told the OceanNewsUK after the results became clear.
Hou You-ih and the main opposition Kuomintang (KMT) ran a campaign that played to the very real fears people here have that China could attack the island.
A KMT win would probably have seen China turn down the rhetoric against Taiwan, and the military intimidation, and it is far more likely that Beijing would agree to dialogue with Mr Hou.
Mr Xi met Taiwan's last KMT president Ma Ying-jeou in 2015. It was the first time that the leaders of Taiwan and China had met face to face since the end of the Chinese civil war in 1949.
But those who oppose the KMT accused it of having a capitulationist attitude to China and not taking the defence of the island seriously, by blocking increases in defence spending and reducing military service on the island to just four months.
The fear was that a KMT government could also make Taiwan more vulnerable. Powerful allies like the US who arm the island would question why they should commit to defending Taiwan if it does not take its own defence seriously.
Taiwan currently spends around 2.5% of its GDP on defence. Much less than the US, or other countries in the region with serious security challenges such as South Korea.
So the voters seem to have made a clear choice. They are aware of the danger from Beijing, and they do want dialogue. But the KMT didn't appeal to those young voters who also increasingly see themselves as Taiwanese rather than Chinese.
And this is despite the fact that the KMT now rarely talks of unification, or even "one China", instead saying it wants to protect Taiwan's peace and security through better relations with Beijing.
The last few months also perhaps drove home what would be Taiwan's biggest loss. Its elections are boisterous affairs, its democracy is still young and the enthusiasm for voting is palpable.
That same democracy also made its dissatisfaction with the DPP clear - rising house prices, stagnant wages and shrinking job opportunities drove young voters away.
And that's why the DPP looks set to lose its majority in the parliament. The KMT in coalition with a third party, the Taiwan People's Party, is likely to muster the seats that will give it a stranglehold over legislation - and an opportunity to block Mr Lai's agenda.
The path ahead is far from smooth for President Lai. Beyond his own government and a giant neighbour that will look to him with antipathy, his term will also be shaped by another election on the other side of the world.
He must be prepared for a very different kind of ally in the White House if Donald Trump becomes the next US president.