HONG KONG — After months of protest, marked by cries for reform and clashes with police, a record number of pro-democracy candidates were elected Sunday in what one former protest leader called a “democratic tsunami.”

In an election where nearly 1,100 candidates were vying for 452 district council seats, the pro-democracy camp had won more than 300 seats as of Monday morning, Reuters reported.

During elections in 2015, they secured roughly one-third that number. On Sunday, pro-establishment candidates scored just 41 seats, according to Reuters.

"This is the power of democracy,” said former student Tommy Cheung, who won a seat in the Yuen Long district close to China’s border.

The victories came after voters braved long lines and hot weather. Residents turned out in droves for district elections widely seen as a test of public opinion amid the increasingly violent protests that have consumed the semi-autonomous Chinese territory for six months.

Turnout was 71.2 percent, according to provisional totals from Hong Kong’s electoral office, with the 2.94m who voted far surpassing the numbers from the 2015 elections.

Among the victors was a candidate who replaced prominent activist Joshua Wong, the only person barred from running in the election.

Rally organizer Jimmy Sham, one of the public faces of the protest movement who was bloodied in an attack by assailants with hammers last month, also triumphed. Pro-Beijing lawmaker Junius Ho, who was stabbed by a knife-wielding man while campaigning this month, was among those who lost.

The elections were in sharp protest to the recent turmoil in Hong Kong. Police kept their distance and online group chats used by the demonstrators encouraged people to vote rather than engage in protest.

People took shade under umbrellas and waited patiently for their turn to vote in elections that have become symbolic for the territory reeling from unrest and violence.

People queue to cast their in Sunday's district council election in Hong Kong. VIVEK PRAKASH / AFP - Getty Images

“This is a de facto referendum for Hong Kong people,” Frank Liu, 32, told NBC News outside a polling station in the city's northwest. “People have taken to the streets and protested against the administration, but the government refuses to listen to our opinion.”

“Our society has been deeply divided for six months," said another voter, Kate Ng, 28. "I’m pregnant so it’s not possible for me to go to rallies to support the democratic movement. This vote means a lot."

A total of 1,090 candidates are vying for 452 seats and 4.1 million people out of a population of 7.4 million have enrolled to vote for district councilors.

A strong showing by the opposition would indicate that the public still supports the anti-government movement, even as the protests have become increasingly violent.

But a vote for Beijing-backed candidates could suggest that Hong Kongers are fed up with the unrest, nearly daily disruptions and the city's bruised reputation as a tourism and finance hub.

The vote also comes in the wake of a dramatic turn last week, when police laid siege to a university campus, trapping hundreds of protesters inside.

For months protesters have been demanding reform in light of a controversial extradition bill — since shelved — which became a lightning rod for concerns of Beijing's creeping influence over the former British colony, returned to Chinese rule in 1997.

The protesters have also been urging the territory's embattled leader Carrie Lam to step down, calling for an independent inquiry into police actions, amnesty for those charged and greater voting rights.

During the months of turmoil, police and protesters have been engaging in increasingly violent clashes — with officers regularly using tear gas, rubber bullets and water cannon to control crowds wielding Molotov cocktails, bricks and even occasional bows and arrows.

“People have nearly used all their ways to express their views,” said Nelson Lee, a professor at the Chinese University of Hong Kong who specializes in Hong Kong government and politics.

“The only possible remaining method is through this local council election. This is a big day for the protesters,” he said, adding that the Hong Kong government will have to accept the public opinion reflected in the election results.

Hong Kong Chief Executive Carrie Lam casts her vote in the district council elections on Sunday. YE AUNG THU / AFP - Getty Images

Lam, who is backed by Beijing, cast her ballot in front of television cameras Sunday and pledged that her government would listen "more intensively" to the views and opinions of district councils on behalf of the local population.

Beijing has so far steered clear of intervening in the protests, saying it has confidence in Lam and her government to resolve the conflict.

However, as tensions escalate the ongoing protests are posing the biggest popular challenge to Chinese President Xi Jinping since he came to power in 2012.

Jasmine Leung and Ed Flanagan reported from Hong Kong. Yuliya Talmazan from London.