Taiwan’s voters handed the long-ruling Nationalists a historic defeat on Saturday, kicking the party of Chiang Kai-shek out of the presidential palace and stripping it and its allies of a parliamentary majority for the first time since the island’s modern political period began in 1949.

But even as President-elect Tsai Ing-wen of the Democratic Progressive Party proclaimed that a “new era” was dawning on the island of 23 million, the biggest question mark hanging over the incoming administration and legislature was how it would deal with the sensitive subject of relations with mainland China.

Tsai, a 59-year-old lawyer-turned-politician with advanced degrees from U.S. and British universities, was elected with 56% of the vote, becoming Taiwan’s first female president and trouncing the Nationalist Party’s Eric Chu, who got just 31%.

Chu became his party’s candidate only three months before election day, after the Nationalists dumped their initial nominee, Hung Hsiu-chu, who was trailing badly in opinion polls. Third-party candidate James Soong garnered nearly 13%.

We failed. The Nationalist Party has lost the elections. We didn’t work hard enough.– Eric Chu, Nationalist Party candidate

The landslide for Tsai and the DPP was a repudiation of the Nationalists, whose campaign had emphasized incumbent Ma Ying-jeou’s pursuit of closer trade and tourism ties with China. Ma, who could not run again after eight years in office, has argued that his overtures toward the mainland had boosted the self-ruled island’s economy and reduced tensions with Beijing.

The Chinese Communist Party regards Taiwan as a breakaway province that must ultimately be reunited with the mainland, by force if necessary, and the Nationalists had stressed “stability” in cross-strait relations as a centerpiece of the campaign.

“We are entering new territory, because Tsai Ing-wen is the head of the Democratic Progressive Party, which Beijing views as committed to Taiwan independence, and there is at least the danger that Beijing would pre-judge her,” said Richard C. Bush, director of the Center for East Asia Policy Studies at the Brookings Institution in Washington.

“And if she does not accommodate to Beijing in the way Beijing would like, then it takes actions to punish Taiwan in a way that would just get people in Taiwan riled up, so you have the danger of a downward spiral.”

“Frankly, it’s pretty hard to know what’s going to happen because both [Chinese President] Xi Jinping and Tsai Ing-wen are guarded in what they say about future policies,” Bush added.

In her first press conference, Tsai said citizens expected “a government that can lead this country into the next generation and a government that is steadfast in protecting this country’s sovereignty.” As far as relations with mainland China, she said she would “work toward maintaining the status quo” in order to bring “peace and stability across the Taiwan Strait in order to bring the greatest benefits and well-being to the Taiwanese people.”

But she warned: “Our democratic system, national identity and international space must be respected. Any forms of suppression will harm the stability of cross-strait relations.”

Three hours after polls closed, Chu appeared outside his Taipei party headquarters in his blue “One Taiwan” campaign jacket. “We failed. The Nationalist Party has lost the elections. We didn’t work hard enough,” he told 400 supporters, making a long bow.

Acknowledging his party had been unable to capture younger voters, he added: “We will start from the grassroots level to build up again. We need to start from the grassroots to foster (the involvement of) younger people.”

The Nationalists also acknowledged that they and their affiliated parties had lost their majority in the 113-member legislature. The DPP captured 68 seats, and the like-minded New Power Party, founded in 2015, won five. Among the new lawmakers elected Saturday was heavy metal band singer Freddy Lim, who ran with the NPP and defeated a Nationalist Party incumbent in central Taipei.

Tsai, who will take office in May, will become only the second member of the DPP to ever serve as Taiwan’s president; her party held the office from 2000 to 2008 under Chen Shui-bian.

To what extent Tsai will be willing or able to continue Ma-style engagement with authorities in Beijing — and how Communist Party leaders will respond to her election — is unclear.

China’s state-run media has in the past denounced Tsai as a “troublemaker” and warned that her election could plunge cross-Strait relations into ruin, though in recent months, as polls showed a Tsai victory increasingly likely, Beijing seems to have moderated some of that rhetoric.

On Saturday, China’s official New China News Agency said Beijing would not intervene in Taiwan’s election and will focus instead on relations with its neighbor. And the Global Times, a nationalistic tabloid in Beijing closely affiliated with the Communist Party, noted in an op-ed that Tsai had “made prudent remarks and took an ambiguous attitude” toward cross-Straits policies, “stressing maintaining the status quo.”

The paper said the mainland “should be more prudent toward the power shift in Taiwan.” Still, in a sign of the sensitivity mainland authorities have about democracy, searches for Tsai Ing-wen’s name and “Taiwan elections” were blocked Saturday evening on the mainland’s Twitter-like service Weibo as results rolled in.

In November, Ma held direct talks with Chinese President Xi in Singapore. While little of substance emerged, the encounter marked the first time since the end of China’s civil war in 1949 that leaders of the two sides have met.

The DPP has long had a pro-independence ethos, adding to the party’s appeal among young voters. Opinion surveys show a large majority of the island’s citizens under 30 regard themselves as Taiwanese, and not Chinese, though polls also show that a large number of Taiwanese support maintaining the island’s murky “status quo” for the time being.

Taiwan is not a member of the United Nations, and has formal diplomatic relations with fewer than two dozen countries because of Beijing’s insistence that there is only “one China.”

DPP voters like Hu Ching-chien, 32, an engineer for a hi-tech company in Hsinchu, said they feared becoming too tightly leashed to the mainland — whose economy itself is slowing — and worried about Beijing using trade ties to exert political pressure on Taiwan. The island began holding direct, democratic presidential elections in the 1990s after decades of one-party rule by the Nationalists.

“Taiwan’s autonomy is the most important issue,” said Hu, who cast his presidential ballot for Tsai.

“I am very happy. I feel I have finally accomplished something for Taiwan, so that Taiwan will have great autonomy instead of just following China,” he added. Although he said he was afraid Tsai’s election might mean greater instability for the island, it’s a risk he said Taiwan must take.

“If there was no change, Taiwan would become just part of China.”

Outside the DPP headquarters on Saturday night, supporters had erected a large sign reading: “Taiwan is NOT part of China! Support Taiwan independence.”

That kind of rhetoric is alarming to Nationalist Party supporters like 60-year-old Alfa Tsou, who owns a toy factory in Shanghai. “Taiwan’s economy very much depends on mainland tourists. If they did not come, it would have a huge impact on our economy,” said Tsou, who helped organize eight busloads of mostly older people to attend a Chu rally on the eve of the election in New Taipei City. “Taiwan relies very heavily on China economically speaking.”

The issue of cross-Strait relations is of particular concern to Washington, which sells weapons to Taiwan and has committed to come to its aid in the event of an attack from the mainland.

The DPP ran a disciplined campaign that appealed in particular to younger Taiwanese who in the last few years have become active in social movements and political protests.

In the spring of 2014, student-led activists occupied Taiwan’s parliament in protest over what they regarded as a move by Ma and the Nationalist-controlled legislature to pass a trade pact with mainland China without sufficient discussion.

This election, Tsai told supporters Friday night at a rally in front of the presidential palace, would “release civil society’s power, adding that “the DPP is part of this force.”

While Tsai sought to keep the focus of the campaign on “domestic” issues including stagnant wages, support for small businesses, and judicial reform, relations with mainland China were never far from the fore.

They bubbled up again on the eve of the election, when a 16-year-old Taiwanese singer, who performs with a South Korean girl group called Twice, came under heavy criticism from some figures on the mainland for waving a Republic of China flag, which is used in Taiwan, on a TV show in November. Her detractors claimed the move showed her support for Taiwanese independence.

In a video released overnight, Chou Tzu-yu issued an apology, reading from a script. “There’s only one China. The two sides of the strait belong to one unified entity,” she said. “I’ve always been proud to be Chinese.”

The incident infuriated many Taiwanese, some of whom likened the recording to a hostage ransom video. Tsai, Chu and Ma’s administration all issued statements in support of Chou, saying she had nothing to apologize for.

“Citizens carrying flags to express national love and recognition is a natural act,” said the Taiwanese government’s Mainland Affairs Council. The agency added it had contacted its counterparts on the mainland “to express our point of view. This matter has already caused a severe wound to Taiwan people’s feelings.”

“We hope mainland China takes the correct view on this matter and urges the mainland side to put the brakes on this sort of matter.” Added Ma in a personal statement: “I hereby would like to tell Miss Chou that she need not apologize. We support her!”

Tsai addressed the controversy after she voted Saturday morning, and again after she was elected. “I believe everyone feels hurt and angry to see that Chou was forced to do what she was made to do,” Tsai told reporters after casting her ballot. “This has offended and hurt the feelings of the people of Taiwan. Everyone should unite to voice their belief to the world that no national of the Republic of China should be [attacked] for identifying with her country.”

Special correspondent Ralph Jennings in Taipei contributed to this report.