With 99 percent of the polling places reporting results, Ms. Tsai had 56 percent of the vote to Mr. Chu’s 31 percent, Taiwan’s Central Election Commission said.

The campaign pivoted largely on economic issues, as growth in Taiwan has slowed significantly over the past year. Wages have stagnated and housing prices in major cities like Taipei have remained out of the reach of many people.

Voters also soured on the departing president, Ma Ying-jeou, and his policy of pursuing a closer relationship with China, Taiwan’s giant neighbor, which considers Taiwan, a self-governed island, to be a part of its territory with which it must eventually be united.

On the night before the elections, speaking to a huge crowd of supporters on a boulevard across from Taiwan’s Presidential Office Building, Ms. Tsai recalled the protests that filled the capital’s streets in recent years. Those included demonstrations over the death of a young soldier and the Sunflower Movement, a student-led protest against the pursuit of a trade bill with China by the Kuomintang.

“Behind me is the presidential office,” she said. “It’s just a few hundred meters away from the people. But those inside the presidential office can’t hear the voice of the people.”