Taiwan's main opposition party the Kuomintang (KMT), which traditionally favours close ties with China, was routed in a key mayoral by-election on Saturday, a vote overshadowed by turmoil in Hong Kong and tensions with Beijing.
The KMT, under its youthful new leader, Johnny Chiang, has been trying to reinvent itself since being trounced by the Democratic Progressive Party (DPP) in January's presidential and parliamentary elections.
The by-election in the southern city of Kaohsiung was called after its KMT mayor, Han Kuo-yu, was removed from office by a massive margin in a recall vote in June, his opponents charging he had little interest in the city.
The DPP's Chen Chi-mai, a former vice premier, won 70% of the votes, thrashing KMT candidate Jane Lee, though only about half of electors turned out.
"The election result proves one thing - a victory for democracy," Chen told cheering supporters.
Lee, wearing a pink t-shirt with the words "keep going" on it, offered her congratulations.
"I know I did not work hard enough," she said in her concession speech.
While the campaign focused on domestic issues like Kaohsiung's heavy debt load, China grabbed the domestic spotlight in the run-up, with the arrest in Hong Kong of media tycoon Jimmy Lai and Chinese military drills near Taiwan.
China claims democratic Taiwan as its "sacred" territory to be taken by force if necessary, and has repeatedly denounced Taiwanese leaders for supporting anti-Beijing protesters in Hong Kong, a former British colony returned to China in 1997 with promises of a high degree of autonomy that many fear is now being eroded.
Chen had cast the election as a way of showing support for Hong Kong and the value of democracy, while President Tsai Ing-wen told a rally in Kaohsiung on Friday evening that China's military threats were Beijing's way of trying to influence the vote.
The KMT, for its part, complained this week that Tsai's offers of help to Hong Kong's people were all talk and no action.
Lee's campaign was not helped after she became embroiled in a plagiarism scandal a few weeks before the vote, accused of copying much of her master's thesis. She tearfully told reporters last month she was going to give up her degree.
Kaohsiung, at the centre of Taiwan's struggle for democracy in the 1970s and 1980s and home to an important port, is normally firm DPP territory, and the party was taken aback when Han unexpectedly won in 2018.
Han was also the KMT's defeated presidential candidate.