Had Taiwan's voters cast their ballots in last weekend's elections for president and legislature on predominantly domestic issues, incumbent President Tsai Ing-wen and her Democratic Progressive Party may well have lost heavily, as they did in 2018's local elections.
As it turned out, the China factor -- its meddling with the election, its threats to Taiwan's sovereignty, its violence in Hong Kong -- largely, but not exclusively, gifted Tsai and the DPP a massive victory. Tsai won a record 8.2 million votes, or 57%, and the DPP surprisingly maintained its majority in the Legislative Yuan.
Despite its scale, this victory poses new challenges to them, to the China-friendly opposition Kuomintang, to China and to Taiwan's international supporters.
The election was a disaster for China. The Chinese would have preferred to see the KMT's Han Kuo-yu win; his more Beijing-friendly stance might have advanced the island's unification with China, part of President Xi Jinping's dream for the rejuvenation of the Chinese nation.
China's pressure on Taiwan at home and abroad increased relentlessly and it made a concerted effort to manipulate the electoral process by spreading false news and disinformation. Although it failed to work this time, the Chinese are likely to continue to refine such tactics for future use.
There will be more hostile rhetoric emanating from Beijing, more pressure on foreign states and companies to conform to Beijing's narrative on the status and history of Taiwan, more chipping away at Taiwan's position in international affairs.
Beijing might be well advised to recalibrate its approach if it is to have any hope of winning a majority of hearts and minds on Taiwan. But it shows no signs of changing its course on this matter.
Both of Taiwan's main parties need to adapt to a world where their immediate environment is dominated by China and to maintain Taiwan's economic prosperity and way of life under those circumstances.
The KMT has traditionally argued the benefits of a closer and more accepting relationship with China, while the DPP seeks to keep as much distance as possible from the mainland. Unification with China is no longer an electoral issue: only a very small minority sees that as in any way an acceptable future.
Taiwan is severely circumscribed in deciding its future, in that it cannot declare itself openly independent -- that is conventional wisdom. But it now functions as an independent political entity even if it is denied the term "state." In future, especially following this election, the debate on the relationship with China is likely to encompass issues of sovereignty and self-determination more openly than it has in the past.
The DPP will need to manage this debate without excessively alienating China. Domestically, the good news for the DPP is that the economy is looking better. The challenge for Tsai's coming term is to convince Taiwan's voters that the DPP remains effective and that its policies, some of which had proved very unpopular, are worth promoting and supporting, and that it can manage the China problem.
The challenge for the KMT is much more serious and existential. Han Kuo-yu was chosen over more traditional conservative candidates because he seemed to have special electoral and populist appeal, not because of any particular political skill. He has now been exposed as a hollow man.
But it was not just the wrong candidate that lost the KMT the election. It was the lack of a clear identification of what the party now stands for. The claim of being better than the DPP at managing the China relationship is no longer enough.
More than anything, China lost the election for the KMT after its unbending stance on unification and the example of Hong Kong, engaged in a monthslong revolt against Chinese rule. The DPP made effective use of the contrast between tightening freedoms in Hong Kong under "one country, two systems" and the running of Taiwan under its democracy.
Meanwhile, Taiwan's demographics are changing and the KMT is seen as the party of the old while younger voters are overwhelmingly pro-DPP. The KMT must find ways to respond.
Taiwan emerged from a long period of authoritarian rule under the old KMT and has developed a successful democracy. This deserves support, so Western governments should be treating Taiwan as a normal country even if formal diplomatic relations are impossible.
This will entail encouraging Taiwan's participation in international organizations and developing more normal bilateral relationships with exchanges at senior official and ministerial levels. They should defend their companies that come under pressure from China over their links with Taiwan. China will seek to exact a price for this, but it is worth paying.
Tsai is now free to pursue her domestic agenda more successfully than she had hoped, even as the China relationship becomes more contentious: debate in Taiwan will move more toward declaring independence and Beijing will turn up the pressure.
Rod Wye is an Associate Fellow with the Asia Pacific Program of Chatham House.