Mayoral votes in Taiwan's two largest cities have ended, with the opposition winning in the capital Taipei but losing in the port of Kaohsiung.
President Chen Shui-bian voted in Taipei
The governing Democratic Progressive Party's candidate narrowly held on to the party's stronghold of Kaohsiung.
But the opposition Kuomintang party's candidate won a huge victory in Taipei.
A BBC correspondent says the result is not the crushing blow some had expected the government to suffer. The vote was seen as a key test for the government.
Many had portrayed the elections as a public referendum on President Chen Shui-bian's administration, following a series of corruption scandals.
Mr Chen's wife and his aides were indicted for embezzlement and their trials are due to get under way next week.
The electoral campaign was tightly fought and involved national as well as local issues, according to the BBC's Caroline Gluck in Taipei.
Mayors are powerful in Taiwan, and the post in Taipei is seen as a stepping stone for presidential hopefuls.
Kuomintang candidate Hau Long-bin, a former environmental minister, won the contest by a margin of more than 10%.
Six candidates battled for mayor in Taipei and five candidates ran for mayor in Kaohsiung.