More than half a million Hong Kong people voted in primaries held by pro-democracy parties to choose candidates for upcoming legislative elections, organisers said on Sunday.

The high turnout for the unofficial poll came despite a government warning that it could be in breach of a tough new security law imposed on the city by Beijing.

Joshua Wong (R) and fellow pro-democracy activists campaign during the primary which was held despite a warning that it could be in breach of a tough new security law imposed by Beijing
Joshua Wong (R) and fellow pro-democracy activists campaign during the primary which was held despite a warning that it could be in breach of a tough new security law imposed by Beijing AFP / ISAAC LAWRENCE

People queued in the intense summer heat at more than 250 polling stations across the city for the two-day vote which opened hours after police raided an opinion pollster helping to conduct the primaries.

After polls closed at 9:00 pm on Sunday, organisers said more than 610,000 people had cast their ballots, including 590,000 digital votes and 21,000 on paper.

"Under the vicious national security law, many people worried if such participation would risk violating the law but many people still came out," said organiser and legal scholar Benny Tai.

Hundreds of thousands queued to vote at polling stations across the city despite the intense summer heat
Hundreds of thousands queued to vote at polling stations across the city despite the intense summer heat AFP / ISAAC LAWRENCE

"I would like to send my respects to everyone," the democracy campaigner said.

The winning candidates are expected to be announced on Monday evening and be endorsed to run for seats in the city's 70-member legislature in September.

"Under the cloud of the national security law, nearly 600,000 people came out and voted -- this is where we can see the courage of Hong Kong people," former legislator and primary organiser Au Nok-hin said earlier before all the votes were tallied.

Beijing imposed the security law last week targeting acts of subversion, secession, terrorism and foreign collusion with a maximum penalty of life imprisonment in response to huge and often violent democracy protests that erupted last year
Beijing imposed the security law last week targeting acts of subversion, secession, terrorism and foreign collusion with a maximum penalty of life imprisonment in response to huge and often violent democracy protests that erupted last year AFP / ISAAC LAWRENCE

On Thursday, constitutional and mainland affairs minister Erick Tsang warned that those "organising, planning and participating" in the primary might commit offences of succession, subversion and colluding with foreign forces under the new security law, according to interviews given to a select few pro-Beijing newspapers.

But that did not stop a mass casting of ballots.

"I really love Hong Kong," Au said. "Hong Kong people have again created a miracle and again told the world that our pro-democratic camp can attract so many to vote."

Beijing imposed the security law on Hong Kong last week targeting acts of subversion, secession, terrorism and foreign collusion with a maximum penalty of life imprisonment, in response to huge and often violent democracy protests that erupted last year.

Similar national security laws are used to crush dissent on the mainland and police in Hong Kong have already arrested people voicing certain political views now deemed illegal, such as advocating independence or greater autonomy.

Police late Friday night raided the office of Public Opinion Research Institute (PORI), a prominent opinion pollster that was helping the pro-democracy camp to conduct the primary.

Police claimed they were responding to a report that PORI computers had been hacked, resulting in an unlawful leak of personal information.

The raid raised concerns over the primary but PORI president Robert Chung said the voting system was safe and its operation was legal and transparent.