Taipei: Pressure was building on Sunday for Taiwan’s president to step down as chief of the island’s China-friendly ruling party after an unprecedented election battering by the opposition threw into doubt efforts to build closer ties with the giant neighbour.

With presidential elections due within two years, President Ma Ying-jeou is unlikely to be able to push forward stalled trade talks with China, which views Taiwan as a breakaway province to be taken back by force, if necessary.

The beating Ma’s Kuomintang party took at Saturday’s local elections shows that its strategy built with Beijing, to pull the island closer using economic ties, is failing, said Nicholas Consonery, of political risk consultancy Eurasia Group.

“It is quite negative for Taiwan-China relations,” said Consonery, a director of the US-based body, referring to the election result, which prompted the resignation of the premier.

Within hours of the poll announcement, barbed wire was hastily run atop the metal gates protecting the Kuomintang’s (KMT) headquarters in the capital, Taipei, as a smattering of protesters gathered outside, shouting “Ma, step down!” Inside, Ma bowed deeply before cameras and apologised for the loss. The protest petered out quickly, but the negative sentiment has been growing for some time.

In March, thousands of young Taiwanese occupied parliament in a demonstration, dubbed the Sunflower movement, against a planned trade pact calling for closer ties with Beijing.

China is Taiwan’s largest trading partner, and has preferred to deal with the party of Chiang Kai-shek that retreated to Taiwan after losing the Chinese civil war in 1949.

The alternative is the opposition Democratic Progressive Party (DPP), which advocates independence for Taiwan.

It now controls major cities in southern Taiwan and prevailed on Saturday in two former KMT strongholds: Taipei, the capital, and Taichung, in central Taiwan.

“Is cross-strait trade for the benefit of all Taiwanese or just for the rich class?” said Ko Wen-je, an independent candidate who triumphed in the mayoral race for Taipei, and was backed by the DPP.

Ko won 57 per cent of the vote against 41 per cent for his KMT rival, to break the ruling party’s 16-year hold on the capital, where every Taiwan president was once mayor, since direct presidential elections began in 1996.

Taiwan’s pride in its democracy helps reinforce the unwillingness of many to be absorbed politically by China. The growing ties with China lay bare larger anxieties, especially among the young, about Taiwan’s identity.

It was this social media-savvy, younger generation that stood up by the hundreds in Taipei’s Liberty Square in October to support anti-China pro-democracy protests in Hong Kong.

“To win over the Sunflower movement generation is to win over the presidency,” said Wang Dan, a leader of the Chinese democracy movement and one of the students in the 1989 protests in Beijing’s Tiananmen Square.

Saturday’s results were a victory for the people of Taiwan, said Tsai Ing-wen, the chairwoman of the DPP, who is widely tipped to be a contender in the 2016 presidential race.

“We will start from the local level and win back Taiwan,” Tsai said. “If a government doesn’t stand on the side of the people, the people can take away its power.”