Updated

The candidates vying to become the mayor of Taiwan's capital, Taipei, faced off in a televised debate on Saturday, two weeks before a host of local elections seen as a barometer of the ruling party's popularity.

The Nov. 24 mayoral election is one of hundreds being held in Taiwan for local government posts that are seen as a test of confidence in the ruling Democratic Progressive Party, which swept to power in 2016 with the election of President Tsai Ing-wen and a solid majority in parliament.

The DPP's main opposition is the Nationalist Party, which relocated from mainland China amid civil war in 1949 and governed Taiwan for decades, first under martial law, then under full democracy beginning in the 1990s. The presidency has since alternated between the two parties, with the Nationalists, also known as the KMT, seen as more pro-China, and the DPP backing formal independence for Taiwan.

In Saturday's debate, incumbent Taipei Mayor Ko Wen-je, an independent, asked voters to continue supporting him, but the ruling party's candidate, Pasuya Yao, said Ko has failed to make any changes in Taipei in the past four years.

Yao further emphasized that Taipei doesn't want to be bound by China's threats.

Ting Shou-chung, the Nationalist Party candidate, pledged to lead Taipei out of economic difficulties and to help foster a better relationship with China.

Two independent candidates — Li Hsi-kun and Wu E-yang — also took part in the debate.

Surveys show most Taiwanese favor their island's current de facto independent status, rejecting both formal independence that might spark a military assault by China and political unification with Beijing.

While China had in recent years largely eschewed threats that might spark a backlash at the polls, this year's elections come against the background of rising tensions over Beijing's demand that Tsai — who is up for re-election in 2020 — acknowledge its "one-China" principle that views Taiwan as a part of China under the Communist Party. China has increased diplomatic and economic pressure on Tsai's administration while staging military drills underscoring its determination to conquer the island by force if necessary.

Yet, local issues are likely to play a bigger factor among voters. The high-tech economy has struggled to match the growth rates of past years, leading to wage stagnation, particularly among the young, while there have also been pushes for pension reform and government streamlining to keep government spending in check.

Taipei's aging housing stock and delays in projects such as a massive new sports and entertainment venue are also issues for voters in the island's capital.

Taiwan's democracy is known for exuberant campaigning, including massive outdoor rallies, caravans of vehicles promoting the candidates, and visits to markets and parks.

Taipei Mayor Ko, 59, gained added attention this year by starring in a rap video, and online messaging has grown increasingly important in one of the world's most wired societies.

That's also brought warnings of cyberattacks and disinformation coming from China, similar to how Russian government-backed entities are believed to have spread fake news in the U.S.

Ko came under attack for skipping a first debate earlier this month, with critics calling him aloof and the mayor defending himself as a diligent administrator.