HONG KONG — The ruling party of Taiwanese President Ma Ying-jeou — in an election carefully watched in Beijing — has managed to win three of five mayoral races in Taiwan, reversing a losing streak in legislative by-elections since Ma's presidential election triumph in 2008.

Even so, however, the Kuomintang won far fewer votes island-wide than the opposition Democratic Progressive Party, suggesting that the president may have problems in 2012, when he will run for a second term.

A postelection poll conducted by the Global Views Survey Research Center showed Ma's public confidence index dropping to 47.5 percent, putting him behind Tsai Ing-wen, chairwoman of the DPP, with 51.2 percent.