Mainland Chinese hackers have attacked two Hong Kong government departments, a US-based security firm said Friday, as the city prepares for a crucial election.

The attack occurred in August, in the run-up to parliamentary elections Sunday, as fear of Beijing’s tightening grip on semi-autonomous Hong Kong creates unprecedented social and political divides.

California-based security firm FireEye said Friday a China-based group they have been tracking since 2011 attacked at least two Hong Kong government agencies early last month.

The firm’s Asia Pacific chief technology officer Bryce Boland believes the group carrying out the attacks, known as APT3, “is sponsored by the People’s Republic of China”.

“Typically when we see government attacks on other governments, it’s about intelligence gathering and trying to gain access to information they can’t get via other means,” Boland told AFP.

“(There is) a lot of discussion, a lot of uncertainty about the political future in Hong Kong. I imagine it is trying to get a clearer picture of what’s going on inside some of these government departments,” he said.

One of the methods used by APT3 in the recent hacks was to send an email claiming to be an election results report, which contained a malicious hyperlink leading to malware.

Authorities have confirmed the attacks saying: “Relevant security measures had already been put in place to block the suspicious emails”.

Boland’s firm was unable to identify the data gathered and did not specify which departments were targeted.

Boland said such attacks have increased since mass “Umbrella Movement” pro-democracy protests in 2014, which have left an aftermath of ongoing political uncertainty.

Photo: HKFP.

Sunday’s vote is the most important election since the rallies, which failed to win political reform from Beijing despite huge numbers and a global spotlight.

Since then, new activists have emerged calling for Hong Kong to break completely from China.

Authorities in the city and in Beijing have repeatedly slammed their stance as illegal.

Hong Kong was handed back to China by Britain in 1997 under an agreement that protects its freedoms for 50 years, but concerns have grown that such liberties are now fading as Beijing increases its influence across a range of areas, from politics to the media.

AFP is a global news agency delivering fast, in-depth coverage of the events shaping our world from wars and conflicts to politics, sports, entertainment and the latest breakthroughs in health, science and technology.