TAIPEI, Taiwan — Populism was supposed to be the winning formula. With the ruling Democratic Progressive Party (D.P.P.) steadily campaigning on growing anxiety over threats to Taiwan’s national identity, the Kuomintang, a party that favors close ties to China, risked being consigned to playing permanent opposition. Populism seemed to offer it a way out.

It was populist promises, after all, that had helped Han Kuo-yu, of the Kuomintang, triumph in local elections in late 2018.

Yet the same playbook failed him and his party miserably in the general elections this weekend. Not only was Mr. Han unable to woo new voters; he couldn’t even hold on to many traditional Kuomintang sympathizers. President Tsai Ing-wen was re-elected with 57.1 percent of the popular vote; the D.P.P. won 61 of the 113 seats in the national Legislature.

The D.P.P.’s victory is partly the result, as many analysts had predicted, of its successful efforts to drag the election back onto the conventional battleground of sovereignty and identity. Ms. Tsai invoked often the protests in Hong Kong to remind voters of the threat that China poses.