Police said a 19-year-old man pulled a semi-automatic pistol from his waistband as officers approached him in Tai Po district on Friday evening.
The shot did not hit anyone and the man was subdued.
A subsequent search of a nearby flat uncovered an AR-15 semi-automatic rifle and more than 250 rounds of ammunition.
Police said they believed the man and the newly discovered weapons were linked to a group arrested earlier this month who were also allegedly found in possession of a pistol and were plotting to attack officers.
Silver-haired sit-in, face mask party protests planned for Hong Kong
"The firearms we discovered matched the intelligence we had collected which indicated that some people hoped to use firearms in some public assemblies to wound some others, including police officers on duty," Senior Superintendent Lee Kwai-wah told reporters on Saturday.
However, Lee said the suspect was also facing ongoing firearms charges from an arrest last year before the protests.
Riot police had to be called in to back up the officers as local residents began heckling police, with at least two tear gas rounds fired to disperse them, the South China Morning Post reported.
Semi-autonomous Hong Kong has been shaken for six months by increasingly violent pro-democracy protests.
They were initially sparked by a now-abandoned attempt to allow extraditions to the authoritarian mainland but have since morphed into a popular revolt against Beijing's rule, with spiralling fears that the city is losing some of its unique liberties.
Millions have marched peacefully in multiple rallies, with Beijing and local leader Carrie Lam digging their heels in.
But a newly radicalised youth armed with petrol bombs, bricks and sometimes bows and arrows has added a dangerous layer to the movement, leading to increasingly violent battles with riot police.
Over the last six months, police have fired more than 16,000 rounds of tear gas and 10,000 rubber bullets. Some 6,000 people have been arrested, with 1,000 charged, a large chunk of the students.
China 'resolutely' backs Hong Kong leader despite polls setback
In recent weeks, police have made arrests indicating some protesters may be plotting more drastic action.
Alongside the arrest earlier this month of a group of people in possession of a pistol, police said they also discovered two homemade nail bombs that had been stored in the grounds of a school.
Both Lam and the Hong Kong police force's reputation have taken a hammering during the protests but Beijing has publicly backed both.
The South China Morning Post published a new poll on Sunday which found 73 percent of respondents felt the police's handling of the protest had eroded trust in the force.
Among the demands being made by protesters is an independent inquiry into the police, amnesty for those arrested and fully free elections.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ