HONG KONG — Pro-democracy parties scored stunning gains in the Hong Kong district council elections Sunday, sweeping aside pro-Beijing parties in a significant endorsement of the protest movement and an indictment of the political establishment seen as responsible for months of unrest in the city.

Voters took to the polls in record numbers to cast ballots in the only fully democratic election in the Chinese territory, an early sign that they wanted to send a strong message to their government and to the Communist Party in Beijing.

Early results compiled by the South China Morning Post showed pro-democracy parties winning 278 of the first 344 seats to be declared, pro-Beijing parties taking 42, and independents 24. Many prominent figures in the protest movement won, and many leading pro-establishment figures were unseated. Pro-democrats look to be able to secure 12 of 18 district councils available in Hong Kong — before this vote, they did not have a majority in any.

Pro-democracy parties had comfortably surpassed the number of seats they won in 2015 and were on course for their strongest showing ever in district council elections. They also appear to have secured all 117 seats afforded to them on the 1,200-member election committee that votes for Hong Kong’s leader — a system designed to give an upper hand in the process to pro-Beijing groups and business interests.

The turnout — 2.94 million, or more than 71 percent of the 4.13 million eligible voters — was more than double the 1.4 million who voted in local elections in 2015. Voter registration was also a record high, driven in part by 390,000 first-time voters.

“Hong Kongers regard the election as a referendum and have clearly spoken that they are unhappy with how Hong Kong and Beijing have dealt with the ongoing protests in the last six months,” said Kelvin Lam, who won the South Horizons West seat, according to the South China Morning Post.

Lam was drafted to contest the seat for the pro-democracy camp after prominent activist Joshua Wong was barred from standing.

In 2015, pro-Beijing parties won just over 54 percent of the vote and 298 of the 452 seats to take control of all 18 district councils. They tend to be better funded and organized than pro-democracy groups, with solid links with the business elite and political establishment that allow them to argue that they are in the best position to get things done for their constituents.

Pro-democracy groups won 40 percent of the vote and 126 seats in 2015. Independents took the remainder.

But this time around, elections that have typically been fought on issues such as traffic, trash collection and the nuisance of pests such as wild boars became a referendum on the most fundamental issue in the territory: Whether one stands with the movement fighting for democratic freedoms or with the pro-
Beijing establishment that has had a grip on the former colony since Britain handed it back to China in 1997.

The protests were sparked in June by a proposal to allow criminal suspects to be extradited to China. The government eventually withdrew the proposal, but not before demonstrators added more demands: Full democracy, retracting the official description of the protests as riots, amnesty for arrested protesters and an inquiry into alleged police brutality.

“The voice of the public is loud and clear: Five demands, not one less,” said Roy Kwong Chun-Yu, who won in the Pek Long constituency. If Hong Kong Chief Executive Carrie Lam “doesn’t listen to our voice,” he said, “she must still not be awake.”

Even in pro-Beijing strongholds such as North Point, fresh-faced candidates running on an explicitly pro-democracy platform unseated longtime incumbents. Among them was 23-year-old Karrine Fu, who beat 45-year-old Hung Lin-Cham, the DAB incumbent who had won the past three elections.

The DAB threw its weight behind the unpopular extradition bill. Its vice chairman, Holden Chow, lost his seat to a 25-year-old pro-democracy activist in one of several upsets for the party.

Lo Kin-Hei, vice chairman of the Democratic Party, called the result a “clear win” for the pro-
democracy camp. “Really wonder what Carrie Lam & [Chinese President] Xi Jinping thought when they see the record-breaking turnout & result today,” he tweeted.

Voters waited in hours-long lines that snaked around city blocks, an unusual experience for Hong Kong residents. Almost every neighborhood has seen violent unrest at some point over the nearly six-month-long protest movement, with police firing tear gas and rubber bullets and protesters countering with molotov cocktails and projectiles.

“Everyone just asks what side you are on, pro-democracy or pro-establishment,” said Sabrina Koo, a pro-democracy candidate. “Only after that do they ask us what our plans are for the community and about local issues.”

Voters, relishing the opportunity to express their democratic rights, were unperturbed by the lines. Gloria Lai, 40, took her two children to a polling station close to a major protest flash point in Wan Chai: a road that in the past months has seen tear gas, water cannons and massive fires. They waited an hour to vote.

“I want my children to always remember that it is their right to vote, it is their right to voice out their opinion, and this is something to be treasured,” she said. “We don’t have the right to vote for our chief executive, but we have this.”

The contest for district council is the only fully democratic election in Hong Kong. The city’s leader is not directly elected. Only half of the Legislative Council, the lawmaking body, is chosen by the people.

Another voter in Wan Chai, which is represented by pro-Beijing politicians, said he flew back to Hong Kong from Britain, where he has lived for the past decade, to cast his ballot. The 39-year-old man, who asked to be identified only by his last name, Chan, said he has never seen such lines in an election, including in Britain.

“This is the best way to express our views. It is the right way,” he said. “We don’t want violence on the streets, but if we don’t have a way to express our political views in any other way, that will happen.”

Francis Lee, who researches public opinion and the media at the Chinese University of Hong Kong, said the high turnout, while “expected because of the heated political and social atmosphere” of recent months, was still impressive for Hong Kong.

“A combination of police tactics and the [subway and rail network’s] tendency to close numerous stations during protest events has made it extremely difficult to hold any large-scale peaceful protests,” he said. “Many moderate supporters of the movement were frustrated by the lack of opportunities to express themselves,” he said, and saw the election as a way to reenter the fold.

The well-funded establishment camp was hoping for support from a “silent majority” that has grown uncomfortable with protest violence in Hong Kong.

Some voters expressed a desire for a return of peace to the city streets and said they were voting for experienced candidates.

“Nothing is more important than bettering the lives of ordinary people,” said a 74-year-old pro-Beijing supporter who gave his last name as Chow. “The responsibility of our youth is to study hard, not to make society a mess.” 

Others said the protest movement had changed their views. Two voters in Sai Wan Ho, where a young protester was shot at close range this month, said they were deeply influenced by what they had seen.

“I couldn’t sleep well last night, I’ve been anticipating this election for so long,” said a 52-year-old man who gave his last name as Wong. “I really hope these elections can change the situation and change the political development of Hong Kong.”

The election was overwhelmingly peaceful and orderly, marking a rare weekend without violence or police action. Riot officers in green fatigues, some wearing masks, were seen at some polling stations, but the atmosphere was generally calm.

Otherwise, it felt like a typical weekend in the city before the protests began in June: Families out shopping and eating and people running errands. The weeks leading up to the vote saw the biggest escalation in violence since the protests began, with hundreds of demonstrators arrested after police seized a university campus that had become a fortified base for the movement.

Two protesters still holed up in Hong Kong Polytechnic University held a news conference urging people to vote.

Hundreds of candidates chose to run in response to the events of the past months. They included Cathy Yau, a police officer who left the force over concerns about abuse of authority and ran on a pro-democracy platform; Jimmy Sham, a leader of the Civil Human Rights Front, the group behind the largest peaceful rallies in the movement; and Tommy Cheung, who decided to contest elections in Yuen Long after mobs attacked protesters at a subway station there.

Sham appeared at his constituency in Sha Tin, walking with the help of cane, a reminder of the political violence against candidates ahead of the vote. Sham was attacked in October by a group of men wielding hammers.