HONG KONG - Taiwan's Beijing-friendly ruling party looked set for humiliation in the island's biggest ever local polls on Saturday, a key test ahead of the 2016 presidential race.
The heavy losses came as the Kuomintang (KMT) struggles with growing fears over Chinese influence, a slowing economy and a string of food scandals.
The KMT lost its key stronghold of Taipei to independent candidate Ko Wen-je, with his rival Sean Lien declaring defeat.
The incumbent KMT mayor in the party's other key stronghold of Taichung, Mr Jason Hu, also conceded a loss to Democratic Progressive Party candidate (DPP) Lin Chia-lung. In the southern municipality of Tainan, the DPP retained its seat.
Television counts showed the DPP ahead in two of the remaining three municipalities, with the KMT only retaining a slender lead in New Taipei.
The local vote is seen as a barometer for leadership elections due in early 2016, with China policy a key issue.
Embattled President Ma Ying-jeou - who came to power in 2008 on a Beijing-friendly platform - must step down at the end of his second four-year term.
Voters lined up at polling stations from early morning and roads, train and bus stations were jammed as people returned to their local neighbourhoods to cast their ballots.
A record 11,130 seats at every level of local government are up for grabs, with 18 million people eligible to vote.
"Many young people are concerned about job prospects and high housing prices so I hope to see change and new thinking in the government to make things better for us," graduate student Mark Hsu told AFP outside a polling station in the capital.
Counting is still under way with full official results expected around 11pm. Turnout was expected to be between 65 per cent and 70 per cent.
Taiwan and China split in 1949 at the end of a civil war, but Beijing still claims the island as part of its territory awaiting reunification, by force if necessary.
Mr Ma has overseen a marked improvement in previously frosty ties between Taipei and Beijing since he ended the Democratic Progressive Party's (DPP's) eight-year rule in 2008 on a platform of boosting the economy and trade with China.
However, the public has grown increasingly anxious over China's influence on the island.
A proposed trade pact with the mainland sparked mass student-led protests and a three-week occupation of Taiwan's Parliament earlier this year.
"I support the DPP because I think the Ma government is leaning too close to China and opening up trade too much... many factories have moved to China and many Taiwanese young people can't find jobs," a retired businessman surnamed Hsiao told AFP at a polling station in Taipei.
The DPP has traditionally been sceptical over closer ties with Beijing and has criticised the KMT for lack of transparency over trade deals with China.
But KMT supporters fear rocking the boat with Beijing.
"I think stability is the most important thing because if the DPP were to regain power, ties with China would become tense again and that would be bad for the economy," said office worker Chin Hui-wen in Taipei.
Before the vote, the KMT dominated 15 of Taiwan's 22 cities and counties, while the DPP held seven.
Of the six larger municipalities - the most hotly contested seats - the KMT controlled three in the north and one in the centre, against the DPP's two in the south.
Mr Ma smiled and waved at reporters as he voted in Taipei earlier Saturday, but made no comment.
DPP chairman Tsai Ing-wen said she was "confident" about the election, speaking outside a polling station in central Taiwan.
Around 60,000 policemen were mobilised across the island, the authorities said, with barbed-wire barricades outside the presidential office.
Taiwan has experienced sporadic election violence, with two high-profile shootings at election-eve campaign events in recent years.