Taiwan President Tsai Ing-wen announced her resignation as leader of the ruling Democratic Progressive Party on Saturday following her party's disastrous defeat in key mayoral elections the same day, races viewed as indicators of voter sentiment ahead of the next presidential and island-wide legislative elections in 2020.

Among DPP candidates so far to concede defeat were incumbent Taichung Mayor Lin Chia-lung, and Chen Chi-mai, the ruling party candidate for mayor of Greater Kaohsiung, Taiwan's third-largest city and a long-time DPP stronghold.

The Central Election Commission website showed that in the Taichung mayoral race, Lin garnered about 43 percent of the votes cast, against 56 percent for his main rival Lu Shiow-yen of the pro-China main opposition Nationalist Party, or Kuomintang (KMT).

In the Kaohsiung race, the CEC website showed DPP candidate Chen received 46 percent of the votes, while his KMT rival Han Kuo-yu garnered more than 50 percent of the ballots.

The CEC website also showed that the DPP candidates were trailing in the races for mayor of the capital Taipei and of New Taipei.

About 19 million eligible voters were expected to cast ballots for more than 11,000 local officials, including the mayors of Taipei and five other special municipal districts.

In all, nine categories of elected office, ranging from big city mayors and county magistrates to village chiefs and borough wardens, were up for grabs in what is commonly known as the "nine-in-one" elections.

As the vote counting continues, the greatest attention is focused on four special municipal districts where the outcome was uncertain and highly significant.

While the mayoral races in Taoyuan and Greater Tainan cities are widely expected to be won by candidates of President Tsai's DPP, polling ahead of the start of voting showed the mayoral races in the capital Taipei, New Taipei, Greater Taichung and Greater Kaoshiung were a dead heat.

The possibility that all four of the latter contests could be won by the KMT is a result that would represent a major setback for the ruling DPP and be welcomed in Beijing.

Before the elections, the DPP controlled four special municipal districts and nine smaller cities and counties, while the KMT controlled only one special municipal district and five smaller cities and counties.

In Taipei, incumbent Mayor Ko Wen-je is currently leading his main opponent, Ting Shou-chung of the KMT, by a thin margin. A political independent, Ko won the 2014 election with the backing of the DPP which decided to field its own candidate this time around.

KMT New Taipei candidate Hou You-yi is holding a significant lead over his DPP rival Su Tseng-chang. Hou hopes to retain the only special municipal district his party controlled before the elections, while Su seeks to reclaim the top job he held from 1997 to 2005.

Nationwide, the electorate also voted on 10 referendums, including one initiated by the KMT to maintain a seven-year ban on food imports from five Japanese prefectures imposed after the 2011 Fukushima nuclear disaster.

The referendums are the first since the voting age on such initiatives was lowered from 20 to 18, and the largest number ever put to a vote on a single day.

Voting stations closed at 4 p.m. without any major incidents and amid good weather that likely boosted voter turnout. Results of the elections were expected to be known by Saturday night, and of the referendums early Sunday morning.