HONG KONG -- Hundreds of thousands of Hong Kong residents turned up over the weekend to vote in an unofficial primary election held by the city's pro-democracy camp as it gears up to field candidates for an upcoming legislative poll.

The primaries were held two weeks after Beijing imposed a sweeping national security law on the semi-autonomous territory in a move widely seen as chipping away at the "one country, two systems" framework under which Britain handed Hong Kong over to China in 1997. It was passed in response to last year's massive protests calling for greater democracy and more police accountability.

Throngs of people lined up at polling booths in the summer heat to vote despite a warning last week by Hong Kong's constitutional affairs minister, Eric Tsang, that the primaries could be in breach of the new national security law because it outlaws interference and disruption of duties by the local government.

Organizers dismissed the comments, saying they just want to hold the government accountable by gaining a majority in the legislature.

The new law prohibits what Beijing views as secessionist, subversive or terrorist activities or as foreign intervention in Hong Kong affairs. Under the law, police now have sweeping powers to conduct searches without warrants and order internet service providers and platforms to remove messages deemed to be in violation of the legislation.

On Friday, police raided the office of the Public Opinion Research Institute, a co-organizer of the primaries. The computer system was suspected of being hacked, causing a data leak, police said in a statement, and an investigation is ongoing.

Hong Kong's pro-democracy camp, which includes multiple parties, is attempting to join forces and use the primaries as a guide to field the best candidates in the official legislative election in September. Its goal is to win a majority in the legislature, which is typically skewed toward the pro-Beijing camp.

To hold the primaries, pro-democracy activists had raised money via crowd funding. They pledged to veto the government's budget if they clinch a majority in the legislature. Under Hong Kong's mini-constitution, known as the Basic Law, the city's leader must resign if an important bill such as the budget is vetoed twice.

Organizers said Sunday that nearly 600,000 people voted at polling booths set up across the city, exceeding organizers' estimates of a turnout of 170,000.

"Despite the threat of the national security law, there are still nearly 600,000 people coming out to vote, " said Au Nok-hin, one of the organizers of the primaries. "We can see Hong Kongers are really brave."